Skip to content

chore: update repo refs #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# A set of files you probably don't want in your WordPress.org distribution
.babelrc
.deployignore
.direnv
.distignore
.editorconfig
.envrc
.eslintignore
.eslintrc
.git
Expand Down Expand Up @@ -47,3 +49,6 @@ docker-compose.yml
output.log
dist
.circleci
flake.nix
flake.lock
Dockerfile-php-build
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use flake

# add your HONEYCOMB_API_KEY and HONEYCOMB_DATASET in .env.local to test HONEYCOMB
if [ -f .env.local ]; then
source .env.local
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules/
*.zip
/vendor/
/generated/
.direnv
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Development
```
git clone git@github.com:GaloyMoney/galoy-woocommerce.git
git clone git@github.com:blinkbitcoin/blink-for-woocommerce.git
```

**Install dependencies with Composer:**
Expand Down
26 changes: 13 additions & 13 deletions assets/js/frontend/blocks.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const settings = window.wc.wcSettings.getSetting( 'galoy_blink_default_data', {} );
const label = window.wp.htmlEntities.decodeEntities( settings.title );
const settings = window.wc.wcSettings.getSetting('blink_default_data', {});
const label = window.wp.htmlEntities.decodeEntities(settings.title);
const Content = () => {
return window.wp.htmlEntities.decodeEntities( settings.description || '' );
return window.wp.htmlEntities.decodeEntities(settings.description || '');
};
const Block_Gateway = {
name: 'galoy_blink_default',
label: label,
content: Object( window.wp.element.createElement )( Content, null ),
edit: Object( window.wp.element.createElement )( Content, null ),
canMakePayment: () => true,
ariaLabel: label,
supports: {
features: settings.supports,
},
name: 'blink_default',
label: label,
content: Object(window.wp.element.createElement)(Content, null),
edit: Object(window.wp.element.createElement)(Content, null),
canMakePayment: () => true,
ariaLabel: label,
supports: {
features: settings.supports,
},
};
window.wc.wcBlocksRegistry.registerPaymentMethod( Block_Gateway );
window.wc.wcBlocksRegistry.registerPaymentMethod(Block_Gateway);
30 changes: 15 additions & 15 deletions blink-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Plugin Name: Blink For Woocommerce
* Plugin URI: https://wordpress.org/plugins/blink-for-woocommerce/
* Description: Blink is a free and open-source bitcoin wallet which allows you to receive payments in Bitcoin and stablesats directly, with no fees, transaction cost or a middleman.
* Author: Galoy - Blink
* Author: Blink
* Author URI: https://blink.sv
* License: MIT
* License URI: https://github.com/GaloyMoney/blink-woocommerce/blob/main/license.txt
* License URI: https://github.com/blinkbitcoin/blink-for-woocommerce/blob/main/license.txt
* Text Domain: blink-for-woocommerce
* Domain Path: /languages
* Version: 0.1.0
Expand All @@ -20,7 +20,7 @@

defined('ABSPATH') || exit();
define('BLINK_VERSION', '0.1.0');
define('BLINK_VERSION_KEY', 'galoy_blink_version');
define('BLINK_VERSION_KEY', 'blink_version');
define('BLINK_PLUGIN_FILE_PATH', plugin_dir_path(__FILE__));
define('BLINK_PLUGIN_URL', plugin_dir_url(__FILE__));
define('BLINK_PLUGIN_ID', 'blink-for-woocommerce');
Expand All @@ -32,12 +32,12 @@ public function __construct() {
$this->includes();

add_action(
'woocommerce_thankyou_galoy_blink_default',
'woocommerce_thankyou_blink_default',
['BlinkWCPlugin', 'orderStatusThankYouPage'],
10,
1
);
add_action('wp_ajax_galoy_blink_notifications', [$this, 'processAjaxNotification']);
add_action('wp_ajax_blink_notifications', [$this, 'processAjaxNotification']);
add_action('admin_enqueue_scripts', [$this, 'enqueueAdminScripts']);

// TODO: add process to run the updates.
Expand Down Expand Up @@ -75,15 +75,15 @@ public function includes(): void {
*/
public function enqueueAdminScripts(): void {
wp_enqueue_script(
'galoy-blink-notifications',
'blink-notifications',
plugin_dir_url(__FILE__) . 'assets/js/backend/notifications.js',
['jquery'],
BLINK_VERSION,
true
);
wp_localize_script('galoy-blink-notifications', 'BlinkNotifications', [
wp_localize_script('blink-notifications', 'BlinkNotifications', [
'ajax_url' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('galoy-blink-notifications-nonce'),
'nonce' => wp_create_nonce('blink-notifications-nonce'),
]);
}

Expand All @@ -96,9 +96,9 @@ public static function initPaymentGateways($gateways): array {
* Handles the AJAX callback to dismiss review notification.
*/
public function processAjaxNotification() {
check_ajax_referer('galoy-blink-notifications-nonce', 'nonce');
check_ajax_referer('blink-notifications-nonce', 'nonce');
// Dismiss review notice for 30 days.
set_transient('galoy_blink_review_dismissed', true, DAY_IN_SECONDS * 30);
set_transient('blink_review_dismissed', true, DAY_IN_SECONDS * 30);
wp_send_json_success();
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public function dependenciesNotification() {
* Displays notice (and link to config page) on admin dashboard if the plugin is not configured yet.
*/
public function notConfiguredNotification(): void {
if (!\Blink\WC\Helpers\GaloyApiHelper::getConfig()) {
if (!\Blink\WC\Helpers\BlinkApiHelper::getConfig()) {
$message = sprintf(
'Plugin not configured yet, please %1$sconfigure the plugin here%2$s',
'<a href="' .
Expand All @@ -151,7 +151,7 @@ public function notConfiguredNotification(): void {
* Shows a notice on the admin dashboard to periodically ask for a review.
*/
public function submitReviewNotification() {
if (!get_transient('galoy_blink_review_dismissed')) {
if (!get_transient('blink_review_dismissed')) {
$reviewMessage = sprintf(
'Thank you for using Blink for WooCommerce! If you like the plugin, we would love if you %1$sleave us a review%2$s.',
'<a href="https://wordpress.org/support/plugin/blink-for-woocommerce/reviews/?filter=5#new-post" target="_blank">',
Expand Down Expand Up @@ -254,9 +254,9 @@ function init_blink_plugin() {
// Setting up and handling custom endpoint for api key redirect from Blink.
add_rewrite_endpoint('blink-settings-callback', EP_ROOT);
// Flush rewrite rules only once after activation.
if (!get_option('galoy_blink_permalinks_flushed')) {
if (!get_option('blink_permalinks_flushed')) {
flush_rewrite_rules(false);
update_option('galoy_blink_permalinks_flushed', 1);
update_option('blink_permalinks_flushed', 1);
}
});

Expand Down Expand Up @@ -308,7 +308,7 @@ function ($links) {

// Installation routine.
register_activation_hook(__FILE__, function () {
update_option('galoy_blink_permalinks_flushed', 0);
update_option('blink_permalinks_flushed', 0);
update_option(BLINK_VERSION_KEY, BLINK_VERSION);
});

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "galoy/blink-for-woocommerce",
"name": "blink/blink-for-woocommerce",
"type": "project",
"license": "MIT",
"autoload": {
Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "Blink Woocommerce plugin development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
php83
php83Packages.composer
nodejs_20
];

shellHook = ''
echo "Blink Woocommerce plugin development environment"
echo "PHP version: $(php --version | head -n 1)"
echo "Composer version: $(composer --version | cut -d' ' -f3)"
echo "Node.js version: $(node --version)"
'';
};
}
);
}
12 changes: 6 additions & 6 deletions languages/blink-for-woocommerce-es.po
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (C) 2024 Galoy - Blink
# Copyright (C) 2024 Blink
# This file is distributed under the same license as the Blink For Woocommerce package.
msgid ""
msgstr ""
"Project-Id-Version: Blink For Woocommerce 0.1.0\n"
"Report-Msgid-Bugs-To: https://chat.galoy.io\n"
"Report-Msgid-Bugs-To: https://chat.blink.sv\n"
"POT-Creation-Date: 2024-05-29 00:37:58+00:00\n"
"PO-Revision-Date: 2024-05-29 00:23-0500\n"
"Last-Translator: \n"
Expand Down Expand Up @@ -153,8 +153,8 @@ msgstr ""
"o intermediarios."

#. Author of the plugin/theme
msgid "Galoy - Blink"
msgstr "Galoy - Blink"
msgid "Blink"
msgstr "Blink"

#. Author URI of the plugin/theme
msgid "https://blink.sv"
Expand Down Expand Up @@ -235,10 +235,10 @@ msgid ""
"This plugin version is %s and your PHP version is %s. Check out our <a href="
"\"https://dev.blink.sv/examples/woocommerce-plugin/\" target=\"_blank"
"\">installation instructions</a>. If you need assistance, please come on our "
"<a href=\"https://chat.galoy.io\" target=\"_blank\">chat</a>. Thank you for "
"<a href=\"https://chat.blink.sv\" target=\"_blank\">chat</a>. Thank you for "
"using Blink!"
msgstr ""
"Esta versión del plugin es %s y tu versión de PHP es %s. Consulta nuestras <a href="
"\"https://dev.blink.sv/examples/woocommerce-plugin/\" target=\"_blank"
"\">instrucciones de instalación</a>. Si necesitas ayuda, por favor, únete a nuestro "
"<a href=\"https://chat.galoy.io\" target=\"_blank\">chat</a>. ¡Gracias por usar Blink!"
"<a href=\"https://chat.blink.sv\" target=\"_blank\">chat</a>. ¡Gracias por usar Blink!"
8 changes: 4 additions & 4 deletions languages/blink-for-woocommerce.pot
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (C) 2024 Galoy - Blink
# Copyright (C) 2024 Blink
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: Blink For Woocommerce 0.1.0\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/blink-woocommerce\n"
"POT-Creation-Date: 2024-09-23 19:56:16+00:00\n"
"https://wordpress.org/support/plugin/blink-for-woocommerce\n"
"POT-Creation-Date: 2024-10-16 04:48:07+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -41,7 +41,7 @@ msgid ""
msgstr ""

#. Author of the plugin/theme
msgid "Galoy - Blink"
msgid "Blink"
msgstr ""

#. Author URI of the plugin/theme
Expand Down
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Galoy Inc
Copyright (c) 2024 Blink LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading