Skip to content

Commit

Permalink
rename lots of things
Browse files Browse the repository at this point in the history
  • Loading branch information
mogmarsh committed Oct 13, 2023
1 parent 98b267d commit fc42dc0
Show file tree
Hide file tree
Showing 87 changed files with 521 additions and 767 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributors: alleyinteractive

Tags: alleyinteractive, newsletter-builder
Tags: alleyinteractive, wp-newsletter-builder

Stable tag: 0.1.0

Expand All @@ -14,8 +14,8 @@ Requires PHP: 8.0

License: GPL v2 or later

[![Coding Standards](https://github.com/alleyinteractive/newsletter-builder/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/alleyinteractive/newsletter-builder/actions/workflows/coding-standards.yml)
[![Testing Suite](https://github.com/alleyinteractive/newsletter-builder/actions/workflows/unit-test.yml/badge.svg)](https://github.com/alleyinteractive/newsletter-builder/actions/workflows/unit-test.yml)
[![Coding Standards](https://github.com/alleyinteractive/wp-newsletter-builder/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/alleyinteractive/wp-newsletter-builder/actions/workflows/coding-standards.yml)
[![Testing Suite](https://github.com/alleyinteractive/wp-newsletter-builder/actions/workflows/unit-test.yml/badge.svg)](https://github.com/alleyinteractive/wp-newsletter-builder/actions/workflows/unit-test.yml)

Interface to manage email newsletters. Creates a Custom Post Type.

Expand All @@ -24,15 +24,15 @@ Interface to manage email newsletters. Creates a Custom Post Type.
You can install the package via composer:

```bash
composer require alleyinteractive/newsletter-builder
composer require alleyinteractive/wp-newsletter-builder
```

## Usage

Activate the plugin in WordPress and use it like so:

```php
$plugin = Newsletter_Builder\Newsletter_Builder\Newsletter_Builder();
$plugin = WP_Newsletter_Builder\WP_Newsletter_Builder\WP_Newsletter_Builder();
$plugin->perform_magic();
```

Expand Down
2 changes: 1 addition & 1 deletion bin/create-block/defaultValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @see https://github.com/WordPress/gutenberg/blob/trunk/packages/create-block/docs/external-template.md#defaultvalues
*/
module.exports = {
namespace: 'newsletter-builder',
namespace: 'wp-newsletter-builder',
plugin: false,
description: '',
dashicon: 'palmtree',
Expand Down
2 changes: 1 addition & 1 deletion bin/create-block/templates/javascript/edit.jsx.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import './index.scss';
export default function Edit() {
return (
<p {...useBlockProps()}>
{ __('Block Title – hello from the editor!', 'newsletter-builder') }
{ __('Block Title – hello from the editor!', 'wp-newsletter-builder') }
</p>
);
}
2 changes: 1 addition & 1 deletion bin/create-block/templates/javascript/index.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Block Name: {{title}}.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions bin/create-block/templates/javascript/render.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* @param string $content Rendered block output. ie. <InnerBlocks.Content />.
* @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

?>
<p <?php echo wp_kses_data( get_block_wrapper_attributes() ); ?>>
<?php esc_html_e( '{{title}} - hello from a dynamic block!', 'newsletter-builder' ); ?>
<?php esc_html_e( '{{title}} - hello from a dynamic block!', 'wp-newsletter-builder' ); ?>
</p>
{{/isDynamicVariant}}
2 changes: 1 addition & 1 deletion bin/create-block/templates/typescript/edit.tsx.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import './index.scss';
export default function Edit() {
return (
<p {...useBlockProps()}>
{ __('Block Title - hello from the editor!', 'newsletter-builder') }
{ __('Block Title - hello from the editor!', 'wp-newsletter-builder') }
</p>
);
}
2 changes: 1 addition & 1 deletion bin/create-block/templates/typescript/index.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Block Name: {{title}}.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions bin/create-block/templates/typescript/render.php.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* @param string $content Rendered block output. ie. <InnerBlocks.Content />.
* @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

?>
<p <?php echo wp_kses_data( get_block_wrapper_attributes() ); ?>>
<?php esc_html_e( '{{title}} - hello from a dynamic block!', 'newsletter-builder' ); ?>
<?php esc_html_e( '{{title}} - hello from a dynamic block!', 'wp-newsletter-builder' ); ?>
</p>
{{/isDynamicVariant}}
10 changes: 5 additions & 5 deletions block-filters/separator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* Adds a separator to a block.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

namespace Newsletter_Builder;
namespace WP_Newsletter_Builder;

/**
* Registers assets so that they can be enqueued through Gutenberg in
Expand All @@ -14,9 +14,9 @@
function register_separator_scripts() {
wp_register_script(
'plugin-newsletter-separator',
get_entry_asset_url( 'newsletter-builder-separator' ),
get_asset_dependency_array( 'newsletter-builder-separator' ),
get_asset_version( 'newsletter-builder-separator' ),
get_entry_asset_url( 'wp-newsletter-builder-separator' ),
get_asset_dependency_array( 'wp-newsletter-builder-separator' ),
get_asset_version( 'wp-newsletter-builder-separator' ),
true
);
wp_set_script_translations( 'plugin-newsletter-separator' );
Expand Down
2 changes: 1 addition & 1 deletion block-filters/separator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { addFilter } from '@wordpress/hooks';

addFilter(
'blocks.registerBlockType',
'newsletter-builder/separator',
'wp-newsletter-builder/separator',
(settings) => ({
...settings,
attributes: {
Expand Down
2 changes: 1 addition & 1 deletion blocks/email-settings/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "newsletter-builder/email-settings",
"name": "wp-newsletter-builder/email-settings",
"version": "0.1.0",
"title": "Email Settings",
"category": "design",
Expand Down
18 changes: 9 additions & 9 deletions blocks/email-settings/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function Edit() {
if (lists.length > 0) {
return;
}
apiFetch({ path: '/newsletter-builder/v1/lists' }).then((response) => {
apiFetch({ path: '/wp-newsletter-builder/v1/lists' }).then((response) => {
setLists(response as any as ListResult[]);
});
}, [lists]);
Expand All @@ -126,32 +126,32 @@ export default function Edit() {
/>
{/* @ts-ignore */}
<TextControl
label={__('Subject', 'newsletter-builder')}
placeholder={__('Enter subject', 'newsletter-builder')}
label={__('Subject', 'wp-newsletter-builder')}
placeholder={__('Enter subject', 'wp-newsletter-builder')}
value={subject}
onChange={(newValue: string) => setMeta({ nb_newsletter_subject: newValue })}
/>
{/* @ts-ignore */}
<TextControl
label={__('Preview Text', 'newsletter-builder')}
placeholder={__('Enter preview text', 'newsletter-builder')}
label={__('Preview Text', 'wp-newsletter-builder')}
placeholder={__('Enter preview text', 'wp-newsletter-builder')}
value={preview}
onChange={(newValue: string) => setMeta({ nb_newsletter_preview: newValue })}
/>
{/* @ts-ignore */}
{lists.length > 0 ? (
<label
htmlFor="newsletter-builder-list"
htmlFor="wp-newsletter-builder-list"
>
{__('Email List', 'newsletter-builder')}
{__('Email List', 'wp-newsletter-builder')}
<MultiSelect
labelledBy={__('List', 'newsletter-builder')}
labelledBy={__('List', 'wp-newsletter-builder')}
value={selected}
options={options}
onChange={setSelectedLists}
hasSelectAll={false}
overrideStrings={{
selectSomeItems: __('Select Email List', 'newsletter-builder'),
selectSomeItems: __('Select Email List', 'wp-newsletter-builder'),
}}
/>
</label>
Expand Down
8 changes: 4 additions & 4 deletions blocks/email-settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* Block Name: Email Settings.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

use Newsletter_Builder\Campaign_Monitor_Client;
use WP_Newsletter_Builder\Campaign_Monitor_Client;

/**
* Registers the block using the metadata loaded from the `block.json` file.
Expand All @@ -14,10 +14,10 @@
*
* @see https://developer.wordpress.org/reference/functions/register_block_type/
*/
function newsletter_builder_email_settings_block_init() {
function wp_newsletter_builder_email_settings_block_init() {
// Register the block by passing the location of block.json.
register_block_type(
__DIR__
);
}
add_action( 'init', 'newsletter_builder_email_settings_block_init' );
add_action( 'init', 'wp_newsletter_builder_email_settings_block_init' );
2 changes: 1 addition & 1 deletion blocks/email-settings/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Replace them with your own styles or remove the file completely.
*/

.wp-block-newsletter-builder-email-settings {
.wp-block-wp-newsletter-builder-email-settings {
background-color: #eee;
padding: 5px;
}
2 changes: 1 addition & 1 deletion blocks/email-settings/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* @param string $content Rendered block output. ie. <InnerBlocks.Content />.
* @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/
2 changes: 1 addition & 1 deletion blocks/footer/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "newsletter-builder/footer",
"name": "wp-newsletter-builder/footer",
"version": "0.1.0",
"title": "Newsletter Footer",
"category": "design",
Expand Down
38 changes: 19 additions & 19 deletions blocks/footer/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function Edit({
setIsLoading(false);
return;
}
apiFetch({ path: '/newsletter-builder/v1/footer_settings' }).then((response) => {
apiFetch({ path: '/wp-newsletter-builder/v1/footer_settings' }).then((response) => {
setFooterSettings(response as any as FooterSettings);
});
}, [footerSettings]);
Expand Down Expand Up @@ -99,62 +99,62 @@ export default function Edit({
<>
{facebookUrl || twitterUrl || instagramUrl || youtubeUrl
? (
<div className="wp-block-newsletter-builder-footer__social-links">
<div className="wp-block-wp-newsletter-builder-footer__social-links">
{facebookUrl
? (
<span className="wp-block-newsletter-builder-footer__social-links__item">
<a className="wp-block-newsletter-builder-footer__social-links__link" href={facebookUrl}>
<img src="/wp-content/plugins/newsletter-builder/images/facebook.png" alt="Facebook" height="26" width="26" />
<span className="wp-block-wp-newsletter-builder-footer__social-links__item">
<a className="wp-block-wp-newsletter-builder-footer__social-links__link" href={facebookUrl}>
<img src="/wp-content/plugins/wp-newsletter-builder/images/facebook.png" alt="Facebook" height="26" width="26" />
</a>
</span>
) : null}
{twitterUrl
? (
<span className="wp-block-newsletter-builder-footer__social-links__item">
<a className="wp-block-newsletter-builder-footer__social-links__link" href={twitterUrl}>
<img src="/wp-content/plugins/newsletter-builder/images/twitter.png" alt="Twitter" height="26" width="26" />
<span className="wp-block-wp-newsletter-builder-footer__social-links__item">
<a className="wp-block-wp-newsletter-builder-footer__social-links__link" href={twitterUrl}>
<img src="/wp-content/plugins/wp-newsletter-builder/images/twitter.png" alt="Twitter" height="26" width="26" />
</a>
</span>
) : null}
{instagramUrl
? (
<span className="wp-block-newsletter-builder-footer__social-links__item">
<a className="wp-block-newsletter-builder-footer__social-links__link" href={instagramUrl}>
<img src="/wp-content/plugins/newsletter-builder/images/instagram.png" alt="Instagram" height="26" width="26" />
<span className="wp-block-wp-newsletter-builder-footer__social-links__item">
<a className="wp-block-wp-newsletter-builder-footer__social-links__link" href={instagramUrl}>
<img src="/wp-content/plugins/wp-newsletter-builder/images/instagram.png" alt="Instagram" height="26" width="26" />
</a>
</span>
) : null}
{youtubeUrl
? (
<span className="wp-block-newsletter-builder-footer__social-links__item">
<a className="wp-block-newsletter-builder-footer__social-links__link" href={youtubeUrl}>
<img src="/wp-content/plugins/newsletter-builder/images/youtube.png" alt="YouTube" height="26" width="26" />
<span className="wp-block-wp-newsletter-builder-footer__social-links__item">
<a className="wp-block-wp-newsletter-builder-footer__social-links__link" href={youtubeUrl}>
<img src="/wp-content/plugins/wp-newsletter-builder/images/youtube.png" alt="YouTube" height="26" width="26" />
</a>
</span>
) : null}
</div>
) : null}
{imageUrl
? (
<div className="wp-block-newsletter-builder-footer__logo">
<div className="wp-block-wp-newsletter-builder-footer__logo">
<img src={imageUrl} alt={imageAltText} width="300" />
</div>
) : null}
{address
? (
<div className="wp-block-newsletter-builder-footer__address">
<div className="wp-block-wp-newsletter-builder-footer__address">
{address}
</div>
)
: null}
</>
)}
<div className="wp-block-newsletter-builder-footer__links">
<div className="wp-block-wp-newsletter-builder-footer__links">
{/* @ts-ignore */}
<preferences>{__('Preferences', 'newsletter-builder')}</preferences>
<preferences>{__('Preferences', 'wp-newsletter-builder')}</preferences>
{' | '}
{/* @ts-ignore */}
<unsubscribe>{__('Unsubscribe', 'newsletter-builder')}</unsubscribe>
<unsubscribe>{__('Unsubscribe', 'wp-newsletter-builder')}</unsubscribe>
</div>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions blocks/footer/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Block Name: Newsletter Footer.
*
* @package newsletter-builder
* @package wp-newsletter-builder
*/

/**
Expand All @@ -12,11 +12,11 @@
*
* @see https://developer.wordpress.org/reference/functions/register_block_type/
*/
function newsletter_builder_footer_block_init() {
function wp_newsletter_builder_footer_block_init() {
// Register the block by passing the location of block.json.
register_block_type(
__DIR__
);

}
add_action( 'init', 'newsletter_builder_footer_block_init' );
add_action( 'init', 'wp_newsletter_builder_footer_block_init' );
2 changes: 1 addition & 1 deletion blocks/footer/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
* Replace them with your own styles or remove the file completely.
*/

// .wp-block-newsletter-builder-footer {
// .wp-block-wp-newsletter-builder-footer {
// }
Loading

0 comments on commit fc42dc0

Please sign in to comment.