From 71f7681936cec081df56ba6d92588d7dd385887f Mon Sep 17 00:00:00 2001 From: Andreas Tasch Date: Mon, 5 Jul 2021 13:32:17 +0200 Subject: [PATCH] Change plugin folder and file naming to properly reflect WP directory slug. --- ...mentsClient.php => WCLAElementsClient.php} | 4 +-- includes/wcla-admin-settings.php | 2 +- ...s.php => liquid-assets-for-woocommerce.php | 26 +++++++++---------- readme.txt | 4 +-- 4 files changed, 17 insertions(+), 19 deletions(-) rename includes/{ElementsClient.php => WCLAElementsClient.php} (98%) rename woocommerce-liquid-assets.php => liquid-assets-for-woocommerce.php (95%) diff --git a/includes/ElementsClient.php b/includes/WCLAElementsClient.php similarity index 98% rename from includes/ElementsClient.php rename to includes/WCLAElementsClient.php index 702969d..15e3556 100644 --- a/includes/ElementsClient.php +++ b/includes/WCLAElementsClient.php @@ -5,7 +5,7 @@ * * @see https://elementsproject.org/en/doc/0.18.1.11/rpc/ */ -class ElementsClient { +class WCLAElementsClient { protected $host; @@ -14,7 +14,7 @@ class ElementsClient { protected $args = []; /** - * ElementsClient constructor. + * WCLAElementsClient constructor. * * @param $rpcHost * @param $rpcUser diff --git a/includes/wcla-admin-settings.php b/includes/wcla-admin-settings.php index ca2ec71..9954ce9 100644 --- a/includes/wcla-admin-settings.php +++ b/includes/wcla-admin-settings.php @@ -67,7 +67,7 @@ function wcla_plugin_setting_mode() { echo ""; } diff --git a/woocommerce-liquid-assets.php b/liquid-assets-for-woocommerce.php similarity index 95% rename from woocommerce-liquid-assets.php rename to liquid-assets-for-woocommerce.php index 5f41b4e..4bdbd6f 100644 --- a/woocommerce-liquid-assets.php +++ b/liquid-assets-for-woocommerce.php @@ -1,25 +1,25 @@ update_meta_data( 'liquid_asset_id', sanitize_text_field( $liquid_asset_id ) ); - $liquid_address = $_POST['liquid_address'] ?? ''; - $product->update_meta_data( 'liquid_address', sanitize_text_field( $liquid_address ) ); + $product->update_meta_data( 'liquid_asset_id', sanitize_text_field( $_POST['liquid_asset_id'] ?? '' ) ); + $product->update_meta_data( 'liquid_address', sanitize_text_field( $_POST['liquid_address'] ?? '' ) ); $product->save(); } add_action( 'woocommerce_process_product_meta', 'wcla_save_custom_field' ); @@ -210,7 +208,7 @@ function wcla_order_payment_complete( $order_id ) { if ($status === 'success') { $msg_asset_sent_status = 'Liquid asset: asset already sent, not sending again.'; } else if ($status === 'error') { - $msg_asset_sent_status = 'Liquid asset: asset sending failed before, not trying again. Please check manually.' + $msg_asset_sent_status = 'Liquid asset: asset sending failed before, not trying again. Please check manually.'; } $logger->add('liquid-assets', $msg_asset_sent_status); @@ -357,14 +355,14 @@ function wcla_coinos_send_liquid_asset( $liquid_address, $asset_id, $quantity ) /** * Init Elements RPC client. * - * @return ElementsClient|null + * @return WCLAElementsClient|null * @throws Exception */ function wcla_elements_rpc_init() { if (!empty($rpc_user = get_option('wcla_plugin_options')['rpc_user']) && !empty($rpc_pass = get_option('wcla_plugin_options')['rpc_pass']) && !empty($rpc_host = get_option('wcla_plugin_options')['rpc_host'])) { - return new ElementsClient($rpc_host, $rpc_user, $rpc_pass); + return new WCLAElementsClient($rpc_host, $rpc_user, $rpc_pass); } return null; } @@ -436,7 +434,7 @@ function wcla_send_admin_mail($message) { if (!empty($mails = get_option('wcla_plugin_options')['admin_mails'])) { // Remove whitespaces. $mails = preg_replace('/\s+/', '', $mails); - return wp_mail( $mails, 'Woocommerce Liquid Assets Plugin', $message); + return wp_mail( $mails, 'Liquid Assets for WooCommerce Plugin', $message); } return false; } diff --git a/readme.txt b/readme.txt index 6f644c2..14d777f 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -=== WooCommerce Liquid Assets === +=== Liquid Assets for WooCommerce === Contributors: ndeet Tags: WooCommerce, Liquid Network, Bitcoin, cryptocurrency @@ -75,7 +75,7 @@ Make also sure your coinos.io account / Elements node has enough funds of Liquid = Automatic installation = This is the easiest option as you can click through everything in the WordPress admin interface. Log in to your WordPress admin panel, navigate to the Plugins menu and click [Add New]. -In the search field type "WooCommerce Liquid Assets". You can install it by simply clicking [Install Now]. After clicking that link you will be asked if you're sure you want to install the plugin. Click yes and WordPress will automatically complete the installation. After installation has finished, click the [activate plugin] link. +In the search field type "Liquid Assets for WooCommerce". You can install it by simply clicking [Install Now]. After clicking that link you will be asked if you're sure you want to install the plugin. Click yes and WordPress will automatically complete the installation. After installation has finished, click the [activate plugin] link. = Manual installation via the WordPress interface = 1. Download the plugin zip file to your computer