Skip to content

Commit

Permalink
update name, slug, files, prefixes to blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Mar 8, 2023
1 parent d80c179 commit 7807ea8
Show file tree
Hide file tree
Showing 74 changed files with 668 additions and 1,656 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/delete-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
delete:
name: On Delete Release
runs-on: ubuntu-latest
if: ${{ github.repository == 'newfold-labs/wp-plugin-crazy-domains' }}
if: ${{ github.repository == 'newfold-labs/wp-plugin-blueprint' }}
steps:

- name: Clear cache for release API
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"files":["https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-crazy-domains"]}'
--data '{"files":["https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-blueprint"]}'
8 changes: 4 additions & 4 deletions .github/workflows/upload-asset-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
uses: actions/checkout@v2

- name: Validate version number
if: ${{ github.repository == 'newfold-labs/wp-plugin-crazy-domains' }}
if: ${{ github.repository == 'newfold-labs/wp-plugin-blueprint' }}
run: |
taggedVersion=${{ env.VERSION }}
pluginHeaderVersion=`grep "Version:" wp-plugin-crazy-domains.php | grep -Eo "[0-9\.]*"`
pluginConstantVersion=`grep "'CRAZYDOMAINS_PLUGIN_VERSION'," wp-plugin-crazy-domains.php | grep -Eo "[0-9\.]*"`
pluginHeaderVersion=`grep "Version:" wp-plugin-blueprint.php | grep -Eo "[0-9\.]*"`
pluginConstantVersion=`grep "'BLUEPRINT_PLUGIN_VERSION'," wp-plugin-blueprint.php | grep -Eo "[0-9\.]*"`
pluginPackageVersion=`grep "version" package.json | grep -Eo "[0-9\.]*"`
echo "Tagged version: $taggedVersion"
echo "Plugin header version: $pluginHeaderVersion"
Expand Down Expand Up @@ -128,4 +128,4 @@ jobs:
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"files":["https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-crazy-domains"]}'
--data '{"files":["https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-blueprint"]}'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cypress.env.json
# Built-app files
/.docs
/build/*
/wp-plugin-crazy-domains
/wp-plugin-blueprint

# File Types
*.log
Expand Down
26 changes: 13 additions & 13 deletions .newfold-project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Crazy Domains WordPress Plugin",
"description": "WordPress plugin that integrates your WordPress site with the Crazy Domains control panel, including performance, security, and update features.",
"url": "https://crazydomains.com",
"name": "Blueprint WordPress Plugin",
"description": "WordPress plugin that integrates your WordPress site with the Blueprint control panel, including performance, security, and update features.",
"url": "https://blueprint.com",
"package": {
"vendor": "newfold",
"name": "wp-plugin-crazy-domains"
"name": "wp-plugin-blueprint"
},
"license": {
"slug": "GPL-2.0-or-later",
Expand All @@ -13,17 +13,17 @@
},
"author": {
"name": "Evan Mullins",
"email": "evanrm@gmail.com",
"email": "evan@bluehost.com",
"url": "https://evanmullins.com"
},
"text_domain": "wp-plugin-crazy-domains",
"namespace": "CrazyDomains",
"text_domain": "wp-plugin-blueprint",
"namespace": "Blueprint",
"prefixes": {
"long": "WPPluginCrazyDomains",
"short": "wppcd",
"function": "wppcd_",
"constant": "WPPCD_",
"meta": "wppcd_",
"slug": "wppcd-"
"long": "WPPluginBlueprint",
"short": "wppb",
"function": "wppb_",
"constant": "WPPB_",
"meta": "wppb_",
"slug": "wppb-"
}
}
4 changes: 2 additions & 2 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"tests": {
"config": {
"WP_TESTS_DOMAIN": "localhost:8881",
"WP_TESTS_EMAIL": "evanrm@gmail.com",
"WP_TESTS_TITLE": "Crazy Domains WordPress Plugin",
"WP_TESTS_EMAIL": "evan@bluehost.com",
"WP_TESTS_TITLE": "Blueprint WordPress Plugin",
"WP_TESTS_BINARY": "php"
}
}
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<a href="https://crazydomains.com/" target="_blank">
<img src="https://raw.githubusercontent.com/newfold-labs/wp-plugin-crazy-domains/main/assets/svg/crazydomains-logo.svg" alt="Crazy Domains Logo" title="Crazy Domains" align="right" height="32" />
<a href="https://blueprint.com/" target="_blank">
<img src="https://raw.githubusercontent.com/newfold-labs/wp-plugin-blueprint/main/assets/svg/blueprint-logo.svg" alt="Blueprint Logo" title="Blueprint" align="right" height="32" />
</a>

# Crazy Domains WordPress Plugin
# Blueprint WordPress Plugin

[![Version Number](https://img.shields.io/github/v/release/newfold-labs/wp-plugin-crazy-domains?color=21a0ed&labelColor=333333)](https://github.com/newfold-labs/wp-plugin-crazy-domains/releases)
[![Lint PHP](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/lint-php.yml/badge.svg?branch=main)](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/lint-php.yml)
[![Lint YML](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/lint-yml.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/lint-yml.yml)
[![WP Internationalization](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/wp-i18n.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/wp-i18n.yml)
[![Cypress](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/cypress.yml/badge.svg?branch=main)](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/cypress.yml)
[![Build Plugin](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/upload-artifact-on-push.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-crazy-domains/actions/workflows/upload-artifact-on-push.yml)
[![Version Number](https://img.shields.io/github/v/release/newfold-labs/wp-plugin-blueprint?color=21a0ed&labelColor=333333)](https://github.com/newfold-labs/wp-plugin-blueprint/releases)
[![Lint PHP](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/lint-php.yml/badge.svg?branch=main)](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/lint-php.yml)
[![Lint YML](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/lint-yml.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/lint-yml.yml)
[![WP Internationalization](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/wp-i18n.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/wp-i18n.yml)
[![Cypress](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/cypress.yml/badge.svg?branch=main)](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/cypress.yml)
[![Build Plugin](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/upload-artifact-on-push.yml/badge.svg)](https://github.com/newfold-labs/wp-plugin-blueprint/actions/workflows/upload-artifact-on-push.yml)

WordPress plugin that integrates a WordPress site with the Crazy Domains control panel, including performance, security, and
WordPress plugin that integrates a WordPress site with the Blueprint control panel, including performance, security, and
update features.

# Installation

Find the `wp-plugin-crazy-domains.zip` asset for your preferred version at: https://github.com/newfold-labs/wp-plugin-crazy-domains/releases/.
Find the `wp-plugin-blueprint.zip` asset for your preferred version at: https://github.com/newfold-labs/wp-plugin-blueprint/releases/.

Alternatively, check the updater endpoint for the latest version at: https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-crazy-domains, this also includes a download link to the latest zip file or use this link to access the latest download: https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-crazy-domains/download/.
Alternatively, check the updater endpoint for the latest version at: https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-blueprint, this also includes a download link to the latest zip file or use this link to access the latest download: https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-blueprint/download/.

# Releasing Updates

This plugin has version number set in 3 distinct places in 2 files:

- the plugin header info (wp-plugin-crazy-domains/wp-plugin-crazy-domains.php line 14) - this is used in the plugin php code.
- the constant CRAZYDOMAINS_PLUGIN_VERSION (wp-plugin-crazy-domains/wp-plugin-crazy-domains.php line 34) - this is used by
- the plugin header info (wp-plugin-blueprint/wp-plugin-blueprint.php line 14) - this is used in the plugin php code.
- the constant BLUEPRINT_PLUGIN_VERSION (wp-plugin-blueprint/wp-plugin-blueprint.php line 34) - this is used by
WordPress.
- in the package.json version value (wp-plugin-crazy-domains/package.json line 5) this is used by the build step to place
- in the package.json version value (wp-plugin-blueprint/package.json line 5) this is used by the build step to place
the release files within a matching version directory for convenient cache busting. All 3 instances need to be
incremented in conjuction with new releases via github tagging.
(In a perfect world, we have a runner increment and/or validate this)
File renamed without changes
File renamed without changes
84 changes: 42 additions & 42 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* Plugin bootstrap file
*
* @package WPPluginCrazyDomains
* @package WPPluginBlueprint
*/

namespace CrazyDomains;
namespace Blueprint;

use WP_Forge\WPUpdateHandler\PluginUpdater;
use WP_Forge\UpgradeHandler\UpgradeHandler;
Expand All @@ -18,76 +18,76 @@
require __DIR__ . '/vendor/autoload.php';
} else {
if ( 'local' === wp_get_environment_type() ) {
wp_die( esc_html( __( 'Please install the Crazy Domains Plugin dependencies.', 'wp-plugin-crazy-domains' ) ) );
wp_die( esc_html( __( 'Please install the Blueprint Plugin dependencies.', 'wp-plugin-blueprint' ) ) );
}
return;
}

/*
* Initialize coming soon module via container
*/
$crazydomains_module_container = new Container(
$blueprint_module_container = new Container(
array(
'cache_types' => array( 'browser', 'file', 'skip404' ),
)
);

// Set plugin to container
$crazydomains_module_container->set(
$blueprint_module_container->set(
'plugin',
$crazydomains_module_container->service(
$blueprint_module_container->service(
function() {
return new Plugin(
array(
'id' => 'crazy-domains',
'file' => CRAZYDOMAINS_PLUGIN_FILE,
'brand' => get_option( 'mm_brand', 'crazy-domains' ),
'install_date' => get_option( 'crazydomains_plugin_install_date' ),
'id' => 'blueprint',
'file' => BLUEPRINT_PLUGIN_FILE,
'brand' => get_option( 'mm_brand', 'blueprint' ),
'install_date' => get_option( 'blueprint_plugin_install_date' ),
)
);
}
)
);

// Set coming soon values
$crazydomains_module_container->set(
$blueprint_module_container->set(
'comingsoon',
array(
'admin_app_url' => admin_url( 'admin.php?page=crazy-domains#/home' ),
'template_h1' => __( 'Coming Soon!', 'wp-plugin-crazy-domains' ),
'template_h2' => __( 'A New WordPress Site', 'wp-plugin-crazy-domains' ),
'admin_app_url' => admin_url( 'admin.php?page=blueprint#/home' ),
'template_h1' => __( 'Coming Soon!', 'wp-plugin-blueprint' ),
'template_h2' => __( 'A New WordPress Site', 'wp-plugin-blueprint' ),
'template_footer_t' => sprintf(
/* translators: %1$s is replaced with opening link tag taking you to crazydomains.com/wordpress, %2$s is replaced with closing link tag, %3$s is replaced with opening link tag taking you to login page, %4$s is replaced with closing link tag, %5$s is replaced with opening link tag taking you to my.crazydomains.com, %6$s is replaced with closing link tag */
esc_html__( 'A %1$sCrazy Domains%2$s powered website. Is this your website? Log in to %3$sWordPress%4$s or %5$sCrazy Domains%6$s.', 'wp-plugin-crazy-domains' ) . '&nbsp;',
'<a href="' . esc_url( 'https://www.crazydomains.com/websites/wordpress' ) . '" target="_blank" rel="noopener noreferrer nofollow">',
/* translators: %1$s is replaced with opening link tag taking you to blueprint.com/wordpress, %2$s is replaced with closing link tag, %3$s is replaced with opening link tag taking you to login page, %4$s is replaced with closing link tag, %5$s is replaced with opening link tag taking you to my.blueprint.com, %6$s is replaced with closing link tag */
esc_html__( 'A %1$sBlueprint%2$s powered website. Is this your website? Log in to %3$sWordPress%4$s or %5$sBlueprint%6$s.', 'wp-plugin-blueprint' ) . '&nbsp;',
'<a href="' . esc_url( 'https://www.blueprint.com/websites/wordpress' ) . '" target="_blank" rel="noopener noreferrer nofollow">',
'</a>',
'<a href="' . esc_url( wp_login_url() ) . '">',
'</a>',
'<a href="' . esc_url( 'https://www.crazydomains.com/my-account/account-center/login' ) . '" target="_blank" rel="noopener noreferrer nofollow">',
'<a href="' . esc_url( 'https://www.blueprint.com/my-account/account-center/login' ) . '" target="_blank" rel="noopener noreferrer nofollow">',
'</a>'
),
'template_page_title' => sprintf(
/* translators: %s: Blog name */
__( '%s &mdash; Coming Soon', 'wp-plugin-crazy-domains' ),
__( '%s &mdash; Coming Soon', 'wp-plugin-blueprint' ),
esc_html( get_option( 'blogname' ) )
),
'admin_bar_text' => '<div style="background-color: #FEC101; color: #000; padding: 0 1rem;">' . __( 'Coming Soon Active', 'wp-plugin-crazy-domains' ) . '</div>',
'admin_bar_text' => '<div style="background-color: #FEC101; color: #000; padding: 0 1rem;">' . __( 'Coming Soon Active', 'wp-plugin-blueprint' ) . '</div>',
'admin_notice_text' => sprintf(
/* translators: %1$s is replaced with the opening link tag to preview the page, and %2$s is replaced with the closing link tag, %3$s is the opening link tag, %4$s is the closing link tag. */
__( 'Your site is currently displaying a %1$scoming soon page%2$s. Once you are ready, %3$slaunch your site%4$s.', 'wp-plugin-crazy-domains' ),
'<a href="' . get_home_url() . '?preview=coming_soon" title="' . __( 'Preview the coming soon landing page', 'wp-plugin-crazy-domains' ) . '">',
__( 'Your site is currently displaying a %1$scoming soon page%2$s. Once you are ready, %3$slaunch your site%4$s.', 'wp-plugin-blueprint' ),
'<a href="' . get_home_url() . '?preview=coming_soon" title="' . __( 'Preview the coming soon landing page', 'wp-plugin-blueprint' ) . '">',
'</a>',
'<a href="' . esc_url( admin_url( 'admin.php?page=crazy-domains#/home' ) ) . '">',
'<a href="' . esc_url( admin_url( 'admin.php?page=blueprint#/home' ) ) . '">',
'</a>'
),
'template_styles' => esc_url( CRAZYDOMAINS_PLUGIN_URL . 'assets/styles/coming-soon.css' ),
'template_styles' => esc_url( BLUEPRINT_PLUGIN_URL . 'assets/styles/coming-soon.css' ),
)
);
setContainer( $crazydomains_module_container );
setContainer( $blueprint_module_container );

// Set up the updater endpoint and map values
$updateurl = 'https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-crazy-domains'; // Custom API GET endpoint
$pluginUpdater = new PluginUpdater( CRAZYDOMAINS_PLUGIN_FILE, $updateurl );
$updateurl = 'https://hiive.cloud/workers/release-api/plugins/newfold-labs/wp-plugin-blueprint'; // Custom API GET endpoint
$pluginUpdater = new PluginUpdater( BLUEPRINT_PLUGIN_FILE, $updateurl );
$pluginUpdater->setDataMap(
array(
'version' => 'version.latest',
Expand All @@ -104,32 +104,32 @@ function() {

// Handle plugin upgrades
$upgrade_handler = new UpgradeHandler(
CRAZYDOMAINS_PLUGIN_DIR . '/inc/upgrades', // Directory where upgrade routines live
get_option( 'crazydomains_plugin_version', '0.1.0' ), // Old plugin version (from database)
CRAZYDOMAINS_PLUGIN_VERSION // New plugin version (from code)
BLUEPRINT_PLUGIN_DIR . '/inc/upgrades', // Directory where upgrade routines live
get_option( 'blueprint_plugin_version', '0.1.0' ), // Old plugin version (from database)
BLUEPRINT_PLUGIN_VERSION // New plugin version (from code)
);

// Returns true if the old version doesn't match the new version
$did_upgrade = $upgrade_handler->maybe_upgrade();

if ( $did_upgrade ) {
// If an upgrade occurred, update the new version in the database to prevent running the routine(s) again.
update_option( 'crazydomains_plugin_version', CRAZYDOMAINS_PLUGIN_VERSION, true );
update_option( 'blueprint_plugin_version', BLUEPRINT_PLUGIN_VERSION, true );
}
}

// Required files
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/Admin.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/AdminBar.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/base.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/jetpack.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/partners.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/performance.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/RestApi/CachingController.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/RestApi/SettingsController.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/RestApi/rest-api.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/settings.php';
require CRAZYDOMAINS_PLUGIN_DIR . '/inc/updates.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/Admin.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/AdminBar.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/base.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/jetpack.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/partners.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/performance.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/RestApi/CachingController.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/RestApi/SettingsController.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/RestApi/rest-api.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/settings.php';
require BLUEPRINT_PLUGIN_DIR . '/inc/updates.php';

/* WordPress Admin Page & Features */
if ( is_admin() ) {
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "newfold-labs/wp-plugin-crazy-domains",
"description": "WordPress plugin that integrates your WordPress site with the Crazy Domains control panel, including performance, security, and update features.",
"name": "newfold-labs/wp-plugin-blueprint",
"description": "WordPress plugin that integrates your WordPress site with the Blueprint control panel, including performance, security, and update features.",
"type": "wordpress-plugin",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Evan Mullins",
"email": "evanrm@gmail.com"
"email": "evan@bluehost.com"
}
],
"config": {
Expand Down Expand Up @@ -44,8 +44,8 @@
"fix": "vendor/bin/phpcbf --standard=phpcs.xml .",
"lint": "vendor/bin/phpcs --standard=phpcs.xml -s .",
"i18n": [
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-crazy-domains.pot --headers=Report-Msgid-Bugs-To:https://github.com/newfold-labs/wp-plugin-crazy-domains/issues --exclude=assets,storybook,tests",
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-crazy-domains.pot --headers=POT-Creation-Date:null --exclude=assets,storybook,tests"
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-blueprint.pot --headers=Report-Msgid-Bugs-To:https://github.com/newfold-labs/wp-plugin-blueprint/issues --exclude=assets,storybook,tests",
"vendor/bin/wp i18n make-pot . ./languages/wp-plugin-blueprint.pot --headers=POT-Creation-Date:null --exclude=assets,storybook,tests"
]
},
"scripts-descriptions": {
Expand All @@ -68,4 +68,4 @@
"wp-forge/wp-update-handler": "^1.0",
"wp-forge/wp-upgrade-handler": "^1.0"
}
}
}
Loading

0 comments on commit 7807ea8

Please sign in to comment.