Skip to content

Commit b9e8628

Browse files
committed
chore: rename from WP Farcaster to Farcaster WP
1 parent 2724ce7 commit b9e8628

21 files changed

+174
-174
lines changed

.github/workflows/generate-zip.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,33 @@ jobs:
3636
uses: thedoctor0/zip-release@master
3737
with:
3838
type: 'zip'
39-
filename: 'wp-farcaster.zip'
39+
filename: 'farcaster-wp.zip'
4040
exclusions: '/*node_modules/* composer.* readme.md package.json .gitignore .eslintrc.js .nvmrc .stylelintrc.json phpcs.xml tsconfig.json bun.lockb .vscode/ .vscode/* .wordpress-org/ .wordpress-org/* src/ src/* src/components/ src/components/* src/hooks/ src/hooks/* src/utils/ src/utils/* /*.git/* /*.github/*'
4141

4242
- name: Upload artifact
4343
uses: actions/upload-artifact@v4
4444
with:
45-
name: wp-farcaster
46-
path: wp-farcaster.zip
45+
name: farcaster-wp
46+
path: farcaster-wp.zip
4747

4848
- name: Upload to release
49-
run: gh release upload ${{ github.event.release.tag_name }} wp-farcaster.zip
49+
run: gh release upload ${{ github.event.release.tag_name }} farcaster-wp.zip
5050
env:
5151
GITHUB_TOKEN: ${{ github.TOKEN }}
5252

5353
- name: Unzip folder for WP.org
5454
uses: montudor/action-zip@v1
5555
with:
56-
args: unzip -qq wp-farcaster.zip -d wp-farcaster
56+
args: unzip -qq farcaster-wp.zip -d farcaster-wp
5757

5858
- name: Upload plugin to WP.org
5959
id: deploy
6060
uses: 10up/[email protected]
6161
env:
6262
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
6363
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
64-
SLUG: wp-farcaster
65-
BUILD_DIR: ./wp-farcaster
64+
SLUG: farcaster-wp
65+
BUILD_DIR: ./farcaster-wp
6666

6767
- name: Attest build provenance
6868
uses: johnbillion/[email protected]

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "davisshaver/wp-farcaster",
3-
"description": "WP Farcaster connects your WordPress site to Farcaster.",
2+
"name": "davisshaver/farcaster-wp",
3+
"description": "Farcaster WP connects your WordPress site to Farcaster.",
44
"type": "wordpress-plugin",
55
"license": "GPL-3.0",
66
"require-dev": {

farcaster-wp.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* Farcaster WP
4+
*
5+
* @package Farcaster_WP
6+
* @author Davis Shaver
7+
* @license: GPL-2.0-or-later
8+
*
9+
* @wordpress-plugin
10+
* Plugin Name: Farcaster WP
11+
* Plugin URI: https://farcaster-wp.davisshaver.com/
12+
* Description: Farcaster WP connects your WordPress site to Farcaster.
13+
* Version: 0.0.10
14+
* Author: Davis Shaver
15+
* Author URI: https://davisshaver.com/
16+
* License: GPL v2 or later
17+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
18+
* Text Domain: farcaster-wp
19+
* Tags: WordPress, web3, Farcaster, Ethereum
20+
* Contributors: davisshaver
21+
*/
22+
23+
defined( 'ABSPATH' ) || exit;
24+
25+
define( 'FARCASTER_WP_VERSION', '0.0.10' );
26+
27+
define( 'FARCASTER_WP_API_NAMESPACE', 'farcaster-wp/v1' );
28+
define( 'FARCASTER_WP_API_URL', get_site_url() . '/wp-json/' . FARCASTER_WP_API_NAMESPACE );
29+
30+
// Define FARCASTER_WP_PLUGIN_DIR.
31+
if ( ! defined( 'FARCASTER_WP_PLUGIN_DIR' ) ) {
32+
define( 'FARCASTER_WP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
33+
}
34+
35+
// Define FARCASTER_WP_PLUGIN_FILE.
36+
if ( ! defined( 'FARCASTER_WP_PLUGIN_FILE' ) ) {
37+
define( 'FARCASTER_WP_PLUGIN_FILE', __FILE__ );
38+
}
39+
40+
// Load language files.
41+
load_plugin_textdomain( 'farcaster-wp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
42+
43+
require_once __DIR__ . '/vendor/autoload.php';
44+
45+
// Include non-class helper functions.
46+
require_once __DIR__ . '/includes/helpers.php';
47+
48+
Farcaster_WP\Initializer::init();

includes/api/class-manifest-controller.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
/**
33
* Manifest API endpoints
44
*
5-
* @package WP_Farcaster\API
5+
* @package Farcaster_WP\API
66
*/
77

8-
namespace WP_Farcaster\API;
8+
namespace Farcaster_WP\API;
99

1010
use WP_REST_Controller;
1111
use WP_Error;
1212
use WP_REST_Response;
13-
use WP_Farcaster\Frames;
13+
use Farcaster_WP\Frames;
1414

1515
defined( 'ABSPATH' ) || exit;
1616

@@ -24,7 +24,7 @@ class Manifest_Controller extends WP_REST_Controller {
2424
*
2525
* @var string
2626
*/
27-
protected $namespace = WP_FARCASTER_API_NAMESPACE;
27+
protected $namespace = FARCASTER_WP_API_NAMESPACE;
2828

2929
/**
3030
* Endpoint resource.
@@ -37,7 +37,7 @@ class Manifest_Controller extends WP_REST_Controller {
3737
* Register the routes.
3838
*/
3939
public function register_routes() {
40-
// Register wp-farcaster/v1/manifest endpoint.
40+
// Register farcaster-wp/v1/manifest endpoint.
4141
register_rest_route(
4242
$this->namespace,
4343
'/' . $this->resource_name,
@@ -60,7 +60,7 @@ public function register_routes() {
6060
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
6161
*/
6262
public function get_manifest() {
63-
$options = get_option( 'wp_farcaster', array() );
63+
$options = get_option( 'farcaster_wp', array() );
6464
$splash_background_color = Frames::get_splash_background_color( $options );
6565
$splash_image_url = Frames::get_splash_image_url( $options );
6666

includes/class-admin.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22
/**
3-
* WP Farcaster plugin administration screen handling.
3+
* Farcaster WP plugin administration screen handling.
44
*
5-
* @package WP_Farcaster
5+
* @package Farcaster_WP
66
*/
77

8-
namespace WP_Farcaster;
8+
namespace Farcaster_WP;
99

1010
/**
1111
* Class to handle the plugin admin pages
1212
*/
1313
class Admin {
1414

15-
const WP_FARCASTER_PAGE_SLUG = 'wp-farcaster';
15+
const FARCASTER_WP_PAGE_SLUG = 'farcaster-wp';
1616

1717
/**
1818
* Runs the initialization.
@@ -30,7 +30,7 @@ public static function init() {
3030
* @return void
3131
*/
3232
public static function action_admin_enqueue_scripts( $admin_page ) {
33-
if ( 'settings_page_wp-farcaster' !== $admin_page ) {
33+
if ( 'settings_page_farcaster-wp' !== $admin_page ) {
3434
return;
3535
}
3636

@@ -43,7 +43,7 @@ public static function action_admin_enqueue_scripts( $admin_page ) {
4343
$asset = include $asset_file;
4444

4545
wp_enqueue_script(
46-
'wp-farcaster-script',
46+
'farcaster-wp-script',
4747
plugins_url( 'build/index.js', plugin_dir_path( __FILE__ ) ),
4848
$asset['dependencies'],
4949
$asset['version'],
@@ -53,7 +53,7 @@ public static function action_admin_enqueue_scripts( $admin_page ) {
5353
);
5454

5555
wp_enqueue_style(
56-
'wp-farcaster-style',
56+
'farcaster-wp-style',
5757
plugins_url( 'build/index.css', plugin_dir_path( __FILE__ ) ),
5858
array_filter(
5959
$asset['dependencies'],
@@ -68,29 +68,29 @@ function ( $style ) {
6868
}
6969

7070
/**
71-
* Add the WP Farcaster settings page to the admin menu.
71+
* Add the Farcaster WP settings page to the admin menu.
7272
*
7373
* @return void
7474
*/
7575
public static function action_admin_menu() {
7676
add_options_page(
77-
__( 'Farcaster', 'wp-farcaster' ),
78-
__( 'Farcaster', 'wp-farcaster' ),
77+
__( 'Farcaster', 'farcaster-wp' ),
78+
__( 'Farcaster', 'farcaster-wp' ),
7979
'manage_options',
80-
self::WP_FARCASTER_PAGE_SLUG,
80+
self::FARCASTER_WP_PAGE_SLUG,
8181
[ __CLASS__, 'render_options_page' ]
8282
);
8383
}
8484

8585
/**
86-
* Render the WP Farcaster settings page.
86+
* Render the Farcaster WP settings page.
8787
*
8888
* @return void
8989
*/
9090
public static function render_options_page() {
9191
printf(
92-
'<div class="wrap" id="wp-farcaster-settings">%s</div>',
93-
esc_html__( 'Loading…', 'wp-farcaster' )
92+
'<div class="wrap" id="farcaster-wp-settings">%s</div>',
93+
esc_html__( 'Loading…', 'farcaster-wp' )
9494
);
9595
}
9696

@@ -101,12 +101,12 @@ public static function render_options_page() {
101101
*/
102102
public static function action_init() {
103103
$default = array(
104-
'message' => __( 'Hello, World!', 'wp-farcaster' ),
104+
'message' => __( 'Hello, World!', 'farcaster-wp' ),
105105
'display' => true,
106106
'size' => 'medium',
107107
'frames_enabled' => false,
108108
'splash_background_color' => '#ffffff',
109-
'button_text' => __( 'Read More', 'wp-farcaster' ),
109+
'button_text' => __( 'Read More', 'farcaster-wp' ),
110110
'splash_image' => array(
111111
'id' => 0,
112112
'url' => '',
@@ -174,7 +174,7 @@ public static function action_init() {
174174

175175
register_setting(
176176
'options',
177-
'wp_farcaster',
177+
'farcaster_wp',
178178
array(
179179
'type' => 'object',
180180
'default' => $default,

includes/class-api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* WP Farcaster API setup.
3+
* Farcaster WP API setup.
44
*
5-
* @package WP_Farcaster
5+
* @package Farcaster_WP
66
*/
77

8-
namespace WP_Farcaster;
8+
namespace Farcaster_WP;
99

10-
use WP_Farcaster\API\Manifest_Controller;
10+
use Farcaster_WP\API\Manifest_Controller;
1111

1212
defined( 'ABSPATH' ) || exit;
1313

includes/class-frames.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
/**
3-
* WP Farcaster plugin frames handling.
3+
* Farcaster WP plugin frames handling.
44
*
5-
* @package WP_Farcaster
5+
* @package Farcaster_WP
66
*/
77

8-
namespace WP_Farcaster;
8+
namespace Farcaster_WP;
99

1010
/**
1111
* Class to handle Farcaster frames integration.
@@ -25,8 +25,8 @@ public static function init() {
2525
* Add image sizes.
2626
*/
2727
public static function action_add_image_size() {
28-
add_image_size( 'wp-farcaster-splash-image', 200, 200, array( 'center', 'center' ) );
29-
add_image_size( 'wp-farcaster-frame-image', 2400, 1600, array( 'center', 'center' ) );
28+
add_image_size( 'farcaster-wp-splash-image', 200, 200, array( 'center', 'center' ) );
29+
add_image_size( 'farcaster-wp-frame-image', 2400, 1600, array( 'center', 'center' ) );
3030
}
3131

3232
/**
@@ -39,7 +39,7 @@ public static function get_splash_image_url( $options ) {
3939
$splash_image = $options['splash_image'] ?? '';
4040

4141
if ( ! empty( $splash_image ) && ! empty( $splash_image['id'] ) ) {
42-
$splash_image_src = wp_get_attachment_image_src( $splash_image['id'], 'wp-farcaster-splash-image' );
42+
$splash_image_src = wp_get_attachment_image_src( $splash_image['id'], 'farcaster-wp-splash-image' );
4343
if ( ! empty( $splash_image_src ) ) {
4444
return $splash_image_src[0];
4545
}
@@ -64,7 +64,7 @@ public static function get_splash_background_color( $options ) {
6464
* @return array|null Frame data array or null if frames are disabled.
6565
*/
6666
public static function get_frame_data() {
67-
$options = get_option( 'wp_farcaster', array() );
67+
$options = get_option( 'farcaster_wp', array() );
6868

6969
if ( empty( $options['frames_enabled'] ) ) {
7070
return null;
@@ -74,19 +74,19 @@ public static function get_frame_data() {
7474

7575
$use_title_as_button_text = $options['use_title_as_button_text'] ?? false;
7676
if ( empty( $use_title_as_button_text ) ) {
77-
$button_text = $options['button_text'] ?? __( 'Read More', 'wp-farcaster' );
77+
$button_text = $options['button_text'] ?? __( 'Read More', 'farcaster-wp' );
7878
} else {
7979
$button_text = mb_strimwidth( wp_get_document_title(), 0, 32, '...' );
8080
}
8181

8282
$splash_image_url = self::get_splash_image_url( $options );
8383
$splash_background_color = self::get_splash_background_color( $options );
8484

85-
$frame_image = get_the_post_thumbnail_url( null, 'wp-farcaster-frame-image' );
85+
$frame_image = get_the_post_thumbnail_url( null, 'farcaster-wp-frame-image' );
8686
if ( empty( $frame_image ) ) {
8787
$fallback_image = $options['fallback_image'] ?? '';
8888
if ( ! empty( $fallback_image ) && ! empty( $fallback_image['id'] ) ) {
89-
$frame_image_src = wp_get_attachment_image_src( $fallback_image['id'], 'wp-farcaster-frame-image' );
89+
$frame_image_src = wp_get_attachment_image_src( $fallback_image['id'], 'farcaster-wp-frame-image' );
9090
if ( ! empty( $frame_image_src ) ) {
9191
$frame_image = $frame_image_src[0];
9292
}
@@ -129,15 +129,15 @@ public static function action_wp_head() {
129129
* Enqueue scripts.
130130
*/
131131
public static function action_enqueue_scripts() {
132-
$options = get_option( 'wp_farcaster', array() );
132+
$options = get_option( 'farcaster_wp', array() );
133133

134134
// Only enqueue if frames are enabled in settings.
135135
if ( ! empty( $options['frames_enabled'] ) ) {
136136
wp_enqueue_script(
137137
'farcaster-frame-sdk',
138138
plugins_url( 'build/sdk.js', plugin_dir_path( __FILE__ ) ),
139139
array(),
140-
WP_FARCASTER_VERSION,
140+
FARCASTER_WP_VERSION,
141141
array(
142142
'in_footer' => true,
143143
'strategy' => 'defer',

includes/class-initializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
/**
3-
* WP Farcaster plugin initialization.
3+
* Farcaster WP plugin initialization.
44
*
5-
* @package WP_Farcaster
5+
* @package Farcaster_WP
66
*/
77

8-
namespace WP_Farcaster;
8+
namespace Farcaster_WP;
99

1010
/**
1111
* Class to handle the plugin initialization

includes/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/**
33
* Helper functions.
44
*
5-
* @package WP_Farcaster
5+
* @package Farcaster_WP
66
*/

0 commit comments

Comments
 (0)