Skip to content

Commit

Permalink
Merge branch 'main' into feature/code-standards-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bradp committed Oct 2, 2024
2 parents 2c77ad7 + f94f7e8 commit 8609fcc
Show file tree
Hide file tree
Showing 53 changed files with 10,199 additions and 5,005 deletions.
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ node_modules
cypress.config.js
set-latest-wp-version.js
webpack.config.js
tailwind.config.js
postcss.config.js

# File Types
/*.json
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/create-milestones.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Create Milestone

on:
workflow_dispatch:
inputs:
due_date:
description: "Provide the due date for the milestone (format: YYYY-MM-DD)"
required: false
default: ""
schedule:
- cron: '0 12 * * 3' # Every Wednesday at noon UTC

permissions:
issues: write
contents: read

jobs:
create-milestone:
runs-on: ubuntu-latest

steps:
- name: Create Milestone
run: |
#!/bin/bash
# Explicitly set the timezone to UTC
export TZ=UTC
echo "Debug: Manually Entered Due Date: ${{ github.event.inputs.due_date }}"
# Get the input date from workflow_dispatch (if provided) or use default logic
if [ -n "${{ github.event.inputs.due_date }}" ]; then
# Use the provided date from workflow_dispatch input
DUE_DATE="${{ github.event.inputs.due_date }}"
echo "Manual input provided. Using input date: $DUE_DATE"
else
# No manual input, use the default: 2 weeks from now
DUE_DATE=$(date -u -d '2 weeks' '+%Y-%m-%d')
echo "No manual input. Using default date 2 weeks from now: $DUE_DATE"
fi
# Set the date format for the milestone title and due date
DATE=$(date -u -d "$DUE_DATE" '+%B %-d, %Y') # Human-readable date
DATE_ISO8601=$(date -u -d "$DUE_DATE" '+%Y-%m-%dT23:59:59Z') # ISO8601 format
# Prepare the description for the milestone
DESCRIPTION="The release is scheduled for $DATE, and PRs should be submitted and made mergeable by EOD $DATE. This means they should have tests passing and merge conflicts resolved. The description for the PR must include details of what is included in the PR and how to test it, and preferably new tests supporting the update.\n\nAny PRs submitted after the deadline will not be included in the release but go in the next release. This includes PRs with tests failing, no description, no screenshots/video demonstrating the update, sufficient Cypress tests, no link to associated JIRA ticket, etc. If no mergeable PRs are submitted for a release, there will be no release that week (unless there is a need for an out-of-cycle release)."
# Debugging outputs
echo "Debug: Human-readable Date: $DATE"
echo "Debug: ISO8601 Date: $DATE_ISO8601"
echo "Debug: Description content: $DESCRIPTION"
# Prepare the JSON payload for the API request
PAYLOAD="{\"title\":\"$DATE Release\", \"description\":\"$DESCRIPTION\", \"due_on\":\"$DATE_ISO8601\", \"state\":\"open\"}"
# Debugging the JSON payload
echo "Debug: Payload: $PAYLOAD"
# Perform the curl request and capture the response
RESPONSE=$(curl -s -w "%{http_code}" -o response_body.txt -X POST \
-H "User-Agent: GitHub-API-Request" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/milestones \
-d "$PAYLOAD")
# Capture HTTP status code and response body
HTTP_STATUS=$(tail -n1 <<< "$RESPONSE")
RESPONSE_BODY=$(cat response_body.txt)
# Debugging the HTTP status and response body
echo "Debug: HTTP Status: $HTTP_STATUS"
echo "Debug: Response Body: $RESPONSE_BODY"
# If the request fails, exit with an error
if [[ "$HTTP_STATUS" -ge 400 ]]; then
echo "Error: Failed to create a milestone."
exit 1
fi
echo "Milestone created successfully."
echo "Response body: $RESPONSE_BODY"
4 changes: 2 additions & 2 deletions .github/workflows/cypress-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- '8.2'
- '8.3'
wpVersion:
- '6.2'
- '6.3'
- '6.4'
- '6.5'
- '6.6'

steps:

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/upload-asset-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,3 @@ jobs:
-H "Content-Type: application/json" \
--data '{"files":["https://hiive.cloud/workers/release-api/plugins/bluehost/bluehost-wordpress-plugin"]}'
- name: Send message to ms teams
uses: dhollerbach/[email protected]
with:
webhook: '${{ secrets.TEAMS_WEBHOOK_URL }}'
message: "Bluehost plugin version ${{ env.VERSION }} has been released!"
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "WordPress/WordPress#tags/6.4.3",
"core": "WordPress/WordPress#tags/6.6.2",
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Steps to follow when releasing a new version of the plugin:
- Ensure `release` branch has properly bumped the version.
- The [plugin header version](bluehost-wordpress-plugin.php#L5).
- The [plugin constant version](bluehost-wordpress-plugin.php#L35).
- The [plugin package veresion](package.json#L5).
- The [plugin package version](package.json#L5).
- Ensure the `release` branch has passing tests.
- Ensure the `release` branch passes linting.
- Tag an initial release candidate version of the plugin (e.g. `X.Y.Z-rc.1`) and be sure to mark it as a pre-release.
Expand Down
Binary file added assets/images/ecomm-addon-ctb-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions bluehost-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* @package WPPluginBluehost
*
* @author Newfold Digital
* @copyright Copyright 2023 by Newfold Digital - All rights reserved.
* @copyright Copyright 2024 by Newfold Digital - All rights reserved.
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: The Bluehost Plugin
* Plugin URI: https://bluehost.com
* Update URI: https://github.com/bluehost/bluehost-wordpress-plugin
* Description: WordPress plugin that integrates a WordPress site with the Bluehost control panel, including performance, security, and update features.
* Version: 3.9.2
* Requires at least: 6.0
* Requires PHP: 7.1
* Tested up to: 6.4.3
* Version: 3.14.12
* Requires at least: 6.4
* Requires PHP: 7.3
* Tested up to: 6.6.2
* Author: Bluehost
* Author URI: https://bluehost.com
* Text Domain: wp-plugin-bluehost
Expand All @@ -33,7 +33,7 @@
}

// Define constants
define( 'BLUEHOST_PLUGIN_VERSION', '3.9.2' );
define( 'BLUEHOST_PLUGIN_VERSION', '3.14.12' );
define( 'BLUEHOST_PLUGIN_FILE', __FILE__ );
define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Expand Down
14 changes: 14 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@
use NewfoldLabs\WP\Context\Context;
use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\ModuleLoader\Plugin;
<<<<<<< HEAD
use WP_Forge\UpgradeHandler\UpgradeHandler;
use WP_Forge\WPUpdateHandler\PluginUpdater;
||||||| 72e3d866bcfe
use NewfoldLabs\WP\Context\Context;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;
use function NewfoldLabs\WP\Context\setContext;
=======
use NewfoldLabs\WP\Context\Context;
use NewfoldLabs\WP\Module\Features\Features;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;
use function NewfoldLabs\WP\Context\setContext;
>>>>>>> main
use function NewfoldLabs\WP\Context\getContext;
use function NewfoldLabs\WP\Context\setContext;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;
Expand Down Expand Up @@ -199,3 +210,6 @@ function () {
if ( is_admin() ) {
new Admin();
}

// Instantiate the Features singleton
Features::getInstance();
81 changes: 79 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
"only": [
"newfold-labs/*"
]
},
"instawp": {
"type": "vcs",
"url": "[email protected]:InstaWP/connect-helpers.git",
"only": [
"instawp/*"
]
}
},
"scripts": {
Expand All @@ -44,18 +51,24 @@
"i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-plugin-bluehost.pot --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/bluehost/bluehost-wordpress-plugin/issues\",\"POT-Creation-Date\":\"2023-03-08T20:13:41+00:00\"}' --exclude=assets,tests,src",
"i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-plugin-bluehost.pot ./languages",
"i18n-mo": "vendor/bin/wp i18n make-mo ./languages",
"i18n-json": "vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n-json-rename": "for f in ./languages/*.json; do mv \"$f\" \"$(echo \"$f\" | sed 's/[0-9a-fA-F]\\{32\\}/bluehost-script/')\"; done",
"i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n": [
"@i18n-pot",
"@i18n-po",
<<<<<<< HEAD
"@i18n-mo"
],
"lint": "@test",
"test": "@test-standards",
"test-standards": [
"./vendor/bin/phpcs --standard=./.phpcs.dist.xml",
"PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix -v --diff --dry-run"
||||||| 72e3d866bcfe
"@i18n-mo"
=======
"@i18n-mo",
"@i18n-json"
>>>>>>> main
]
},
"scripts-descriptions": {
Expand All @@ -66,12 +79,20 @@
"i18n-pot": "Generate a .pot file for translation.",
"i18n-po": "Update existing .po files.",
"i18n-mo": "Generate new language .mo files.",
<<<<<<< HEAD
"i18n-json": "Generate new language .json files.",
"i18n-json-rename": "Rename the language json files to remove the pesky hash.",
"test": "Run all test scripts.",
"test-standards": "Check files against coding standards without fixing."
||||||| 72e3d866bcfe
"i18n-json": "Generate new language .json files.",
"i18n-json-rename": "Rename the language json files to remove the pesky hash."
=======
"i18n-json": "Generate new language .json files."
>>>>>>> main
},
"require-dev": {
<<<<<<< HEAD
"dealerdirect/phpcodesniffer-composer-installer": "@stable",
"friendsofphp/php-cs-fixer": "^2.19",
"newfold-labs/wp-php-standards": "^1.2",
Expand All @@ -81,10 +102,66 @@
"wp-cli/i18n-command": "^2.5.0",
"wp-coding-standards/wpcs": "^3.0",
"wp-phpunit/wp-phpunit": "^6.4.2"
||||||| 72e3d866bcfe
"roave/security-advisories": "dev-latest",
"newfold-labs/wp-php-standards": "^1.2",
"wp-cli/i18n-command": "^2.5.0",
"wp-phpunit/wp-phpunit": "^6.4.2"
=======
"roave/security-advisories": "dev-latest",
"newfold-labs/wp-php-standards": "^1.2.4",
"wp-cli/i18n-command": "^2.6.2",
"wp-phpunit/wp-phpunit": "^6.6.2"
>>>>>>> main
},
"require": {
<<<<<<< HEAD
"wp-forge/wp-upgrade-handler": "^1.0",
"newfold-labs/wp-module-sso": "^1.0.4",
||||||| 72e3d866bcfe
"newfold-labs/wp-module-activation": "^1.0.1",
"newfold-labs/wp-module-coming-soon": "^1.2.3",
"newfold-labs/wp-module-context": "^1.0.0",
"newfold-labs/wp-module-data": "^2.4.20",
"newfold-labs/wp-module-deactivation": "^1.1.1",
"newfold-labs/wp-module-ecommerce": "^1.3.25",
"newfold-labs/wp-module-global-ctb": "^1.0.11",
"newfold-labs/wp-module-help-center": "^1.0.24",
"newfold-labs/wp-module-loader": "^1.0.10",
"newfold-labs/wp-module-marketplace": "^2.2.4",
"newfold-labs/wp-module-notifications": "^1.2.5",
"newfold-labs/wp-module-onboarding": "^2.1.8",
"newfold-labs/wp-module-patterns": "^0.1.15",
"newfold-labs/wp-module-performance": "^1.4.0",
"newfold-labs/wp-module-runtime": "^1.0.9",
"newfold-labs/wp-module-secure-passwords": "^1.1.1",
"newfold-labs/wp-module-sso": "^1.0.4",
"newfold-labs/wp-module-staging": "^1.3.0",
=======
"newfold-labs/wp-module-activation": "^1.0.3",
"newfold-labs/wp-module-atomic": "^1.3.0",
"newfold-labs/wp-module-coming-soon": "^1.2.6",
"newfold-labs/wp-module-context": "^1.0.1",
"newfold-labs/wp-module-data": "^2.6.3",
"newfold-labs/wp-module-deactivation": "^1.2.3",
"newfold-labs/wp-module-ecommerce": "^1.3.44",
"newfold-labs/wp-module-facebook": "^1.0.9",
"newfold-labs/wp-module-features": "^1.4.2",
"newfold-labs/wp-module-global-ctb": "^1.0.13",
"newfold-labs/wp-module-help-center": "^2.1.0",
"newfold-labs/wp-module-loader": "^1.0.10",
"newfold-labs/wp-module-marketplace": "^2.4.0",
"newfold-labs/wp-module-migration": "^1.0.11",
"newfold-labs/wp-module-my-products": "^1.0.6",
"newfold-labs/wp-module-notifications": "^1.6.0",
"newfold-labs/wp-module-onboarding": "^2.4.1",
"newfold-labs/wp-module-patterns": "^2.4.1",
"newfold-labs/wp-module-performance": "2.0.1 as 1.9.9",
"newfold-labs/wp-module-runtime": "^1.0.11",
"newfold-labs/wp-module-secure-passwords": "^1.1.1",
"newfold-labs/wp-module-sso": "^1.0.6",
"newfold-labs/wp-module-staging": "^2.1.1",
>>>>>>> main
"wp-forge/wp-update-handler": "^1.0.2",
"newfold-labs/wp-module-data": "^2.4.20",
"newfold-labs/wp-module-context": "^1.0.0",
Expand Down
Loading

0 comments on commit 8609fcc

Please sign in to comment.