diff --git a/.distignore b/.distignore index 3d1c998..0351edb 100644 --- a/.distignore +++ b/.distignore @@ -31,10 +31,10 @@ phpcs.xml phpcbf.xml .eslintignore build/*.map -phpunit.xml.dist +phpunit.xml playwright.config.js .gitpod.yml /node_modules /vendor -flutterwave-payments.zip +rave-payment-forms.zip diff --git a/.github/actions/make-build/action.yml b/.github/actions/make-build/action.yml index 0851430..aa586ee 100644 --- a/.github/actions/make-build/action.yml +++ b/.github/actions/make-build/action.yml @@ -20,7 +20,7 @@ runs: id: build_plugin shell: bash env: - RELEASE_FILENAME: 'flutterwave-payments.zip' + RELEASE_FILENAME: 'rave-payment-forms.zip' run: | npm install npm run build diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ee6ab2a..2f9cce7 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -15,6 +15,10 @@ jobs: if: ${{ always() }} - name: Checkout code uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v2.5.2 + with: + node-version-file: .nvmrc - name: Build Plugin uses: ./.github/actions/make-build - name: WordPress Plugin Deploy diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml new file mode 100644 index 0000000..b46d569 --- /dev/null +++ b/.github/workflows/security-scan.yml @@ -0,0 +1,27 @@ +name: Security scan on all changes (Commits/PRs) + +on: + push: + branches: ['main', 'master', 'pilot', 'dev'] + pull_request: + types: + - opened + +jobs: + code-check: + runs-on: ubuntu-latest + env: + OS: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v2 + + - name: Checkmarx One ClI Action + uses: checkmarx/ast-github-action@main + with: + project_name: WordPress + cx_tenant: Flutterwave + base_uri: https://eu.ast.checkmarx.net/ + cx_client_id: ${{ secrets.CX_CLIENT_ID }} + cx_client_secret: ${{ secrets.CX_CLIENT_SECRET }} + additional_params: --scan-types sast,iac-security,api-security,sca,container-security \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3f98af7..0401cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ node_modules *.DS_Store docs/.vitepress/dist docs/.vitepress/cache -flutterwave-payments.zip +rave-payment-forms.zip .env .env.e2e .phpunit.result.cache diff --git a/.wp-env.json b/.wp-env.json index 343c1f0..ddd7167 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,7 +1,7 @@ { "core": "https://wordpress.org/latest.zip", "phpVersion": "7.4", - "plugins": ["flutterwave-payments.zip"], + "plugins": ["rave-payment-forms.zip"], "port": 1000, "testsPort": 1001, "config": { diff --git a/CHANGELOG.md b/CHANGELOG.md index 405ba38..aab1fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog +## 1.0.7 | 29-08-2023 +Update admin settings view for Transactions. + +### Version Changes +- [FIXED] Missing WP_List_Table implementation. +- [CHANGED] Tested to WP version 6.3 (latest). ## 1.0.6 | 17-05-2023 Security updates and libraty enhancements. This release add the necessary enhancements for faster payment verifications, vulnerabilities fix and UX improvements. diff --git a/Makefile b/Makefile index d2b3868..837259a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ i18n-pot: composer run makepot zip: - rm flutterwave-payments.zip && npm run plugin-zip + rm rave-payment-forms.zip && npm run plugin-zip inspection: ./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP diff --git a/bin/docker-setup.sh b/bin/docker-setup.sh index ea26c08..bc71b8f 100755 --- a/bin/docker-setup.sh +++ b/bin/docker-setup.sh @@ -32,7 +32,7 @@ while [[ $? -ne 0 ]]; do done # If the plugin is already active then return early -cli wp plugin is-active flutterwave-payments > /dev/null +cli wp plugin is-active rave-payment-forms > /dev/null if [[ $? -eq 0 ]]; then set -e echo @@ -89,7 +89,7 @@ echo "Installing and activating Storefront theme..." cli wp theme install storefront --activate echo "Activating the Flutterwave Payments plugin..." -cli wp plugin activate flutterwave-payments +cli wp plugin activate rave-payment-forms echo "Installing and Activating Transient Manager Plugin ..." cli wp plugin install transients-manager --activate diff --git a/composer.json b/composer.json index 94eb7f6..82c319c 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "./vendor/bin/phpcs --runtime-set testVersion 7.2- --standard=PHPCompatibilityWP --extensions=php --ignore=vendor/*,*/build/*.asset.php,*/node_modules/* ." ], "makepot-audit": [ - "wp --allow-root i18n make-pot . --exclude=\".github,.wordpress-org,bin,node_modules,tests,docs\" --slug=flutterwave-payments --debug" + "wp --allow-root i18n make-pot . --exclude=\".github,.wordpress-org,bin,node_modules,tests,docs\" --slug=rave-payment-forms --debug" ], "makepot": [ "@makepot-audit --skip-audit" @@ -56,8 +56,8 @@ "test": "Run unit tests", "standards:check": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", "standards:fix": "Fix coding standards warnings/errors automatically with PHP Code Beautifier", - "makepot-audit": "Generate i18n/languages/flutterwave-payments.pot file and run audit", - "makepot": "Generate i18n/languages/flutterwave-payments.pot file" + "makepot-audit": "Generate i18n/languages/rave-payment-forms.pot file and run audit", + "makepot": "Generate i18n/languages/rave-payment-forms.pot file" } }, "minimum-stability": "stable", diff --git a/composer.lock b/composer.lock index d90f191..465d4eb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b1403fbd1d501bb9ce9e04927661609a", + "content-hash": "6fb7a634d1ea6a49800694913c5c4e9d", "packages": [], "packages-dev": [ { diff --git a/i18n/languages/rave-payment-forms.pot b/i18n/languages/rave-payment-forms.pot new file mode 100644 index 0000000..f860ce6 --- /dev/null +++ b/i18n/languages/rave-payment-forms.pot @@ -0,0 +1,278 @@ +# Copyright (C) 2023 Flutterwave Developers +# This file is distributed under the MIT License. +msgid "" +msgstr "" +"Project-Id-Version: Flutterwave Payments 1.0.6\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rave-payment-forms\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2023-05-19T08:02:43+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.5.0\n" +"X-Domain: rave-payment-forms\n" + +#. Plugin Name of the plugin +#: includes/class-flw-admin-settings.php:139 +msgid "Flutterwave Payments" +msgstr "" + +#. Plugin URI of the plugin +msgid "http://flutterwave.com/" +msgstr "" + +#. Description of the plugin +msgid "Flutterwave payment gateway forms, accept local and international payments securely." +msgstr "" + +#. Author of the plugin +msgid "Flutterwave Developers" +msgstr "" + +#. Author URI of the plugin +msgid "https://developer.flutterwave.com/" +msgstr "" + +#: includes/class-flutterwave-payments.php:189 +msgid "Flutterwave Payments is installed. - " +msgstr "" + +#: includes/class-flutterwave-payments.php:191 +msgid "Enter your Flutterwave \"Pay Checkout\" Public Key and Secret Key to start accepting payments" +msgstr "" + +#: includes/class-flw-admin-settings.php:150 +msgid "Flutterwave Payments Settings" +msgstr "" + +#: includes/class-flw-admin-settings.php:151 +msgid "Settings" +msgstr "" + +#: includes/class-flw-payment-list.php:45 +msgid "Payment List" +msgstr "" + +#: includes/class-flw-payment-list.php:46 +#: includes/class-flw-payment-list.php:277 +msgid "Payment Lists" +msgstr "" + +#: includes/class-flw-payment-list.php:64 +msgid "No payments have been made yet." +msgstr "" + +#: includes/class-flw-payment-list.php:141 +msgid "Transaction Ref" +msgstr "" + +#: includes/class-flw-payment-list.php:142 +msgid "Customer" +msgstr "" + +#: includes/class-flw-payment-list.php:143 +msgid "Customer Fullname" +msgstr "" + +#: includes/class-flw-payment-list.php:144 +#: includes/shortcodes/class-abstract-flw-shortcode.php:184 +#: includes/vc-elements/class-flw-vc-simple-form.php:47 +#: views/donation-payment.php:61 +#: views/donation-payment.php:62 +msgid "Amount" +msgstr "" + +#: includes/class-flw-payment-list.php:145 +#: includes/shortcodes/class-abstract-flw-shortcode.php:191 +#: includes/shortcodes/class-abstract-flw-shortcode.php:198 +#: views/donation-payment.php:67 +msgid "Currency" +msgstr "" + +#: includes/class-flw-payment-list.php:146 +msgid "Status" +msgstr "" + +#: includes/class-flw-payment-list.php:147 +msgid "Date" +msgstr "" + +#: includes/class-flw-payment-list.php:207 +msgid "Transaction List" +msgstr "" + +#: includes/class-flw-payment-list.php:208 +msgid "Transactions" +msgstr "" + +#: includes/class-flw-payment-list.php:278 +msgid "Flutterwave payment lists" +msgstr "" + +#: includes/class-flw-shortcodes.php:38 +msgid "Please configure Flutterwave Payments settings correctly. API keys are still missing." +msgstr "" + +#: includes/class-flw-shortcodes.php:48 +msgid "Please configure Flutterwave Payments settings correctly. Redirect Urls are missing." +msgstr "" + +#: includes/integrations/class-flw-thirdparty-integrations.php:161 +msgid "Flutterwave Payments Integrations" +msgstr "" + +#: includes/integrations/class-flw-thirdparty-integrations.php:162 +msgid "Integrations" +msgstr "" + +#: includes/shortcodes/class-abstract-flw-shortcode.php:177 +#: views/donation-payment.php:33 +#: views/donation-payment.php:34 +msgid "Email" +msgstr "" + +#: includes/shortcodes/class-abstract-flw-shortcode.php:205 +msgid "Full Name" +msgstr "" + +#: includes/shortcodes/class-abstract-flw-shortcode.php:212 +msgid "Phone Number" +msgstr "" + +#: includes/shortcodes/class-abstract-flw-shortcode.php:219 +#: views/donation-payment.php:40 +#: views/donation-payment.php:41 +msgid "First Name" +msgstr "" + +#: includes/shortcodes/class-abstract-flw-shortcode.php:226 +#: views/donation-payment.php:47 +#: views/donation-payment.php:48 +msgid "Last Name" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:37 +msgid "Flutterwave Simple Form" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:39 +msgid "Flutterwave Simple Pay Now Form" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:40 +msgid "Flutterwave Forms" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:50 +msgid "If left blank, user will be asked to enter the amount to complete the payment." +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:58 +msgid "Use logged-in user's email?" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:59 +msgid "Check this if you want the logged-in user's email to be used. If unchecked or user is not logged in, they will be asked to fill in their email address to complete payment." +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:63 +msgid "Yes" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:70 +msgid "Button Text" +msgstr "" + +#: includes/vc-elements/class-flw-vc-simple-form.php:73 +msgid "(Optional) The text on the PAY NOW button. Default: \"PAY NOW\"" +msgstr "" + +#: src/API/class-handler.php:42 +msgid "This Services are Currently Unavailable. Please contact support." +msgstr "" + +#: src/API/class-handler.php:43 +msgid "You do not have the right permission to this service. please ensure your secret_key has been supplied." +msgstr "" + +#: views/admin-integrations-page.php:30 +msgid "view integration" +msgstr "" + +#: views/admin-settings-page.php:26 +msgid "Pay Button Public Key" +msgstr "" + +#: views/admin-settings-page.php:36 +msgid "Pay Button Secret Key" +msgstr "" + +#: views/admin-settings-page.php:47 +msgid "Secret Hash" +msgstr "" + +#: views/admin-settings-page.php:58 +msgid "Webhook URL" +msgstr "" + +#: views/admin-settings-page.php:62 +msgid "Please copy this webhook URL and paste on the webhook section on your dashboard" +msgstr "" + +#: views/admin-settings-page.php:70 +msgid "Go Live" +msgstr "" + +#: views/admin-settings-page.php:77 +msgid "Switch to live account" +msgstr "" + +#: views/admin-settings-page.php:85 +msgid "Payment Method" +msgstr "" + +#: views/admin-settings-page.php:102 +msgid "Modal Title" +msgstr "" + +#: views/admin-settings-page.php:112 +msgid "Modal Description" +msgstr "" + +#: views/admin-settings-page.php:122 +msgid "Modal Logo" +msgstr "" + +#: views/admin-settings-page.php:132 +msgid "Donation Title" +msgstr "" + +#: views/admin-settings-page.php:142 +msgid "Donation Description" +msgstr "" + +#: views/admin-settings-page.php:152 +msgid "Donation Phone" +msgstr "" + +#: views/admin-settings-page.php:162 +msgid "Pending Redirect URL" +msgstr "" + +#: views/admin-settings-page.php:172 +msgid "Success Redirect URL" +msgstr "" + +#: views/admin-settings-page.php:182 +msgid "Failed Redirect URL" +msgstr "" + +#: views/admin-settings-page.php:192 +msgid "Donation Plan Id" +msgstr "" + +#: views/donation-payment.php:52 +msgid "Payment Type" +msgstr "" diff --git a/includes/class-flutterwave-payments.php b/includes/class-flutterwave-payments.php index e9a19f9..1de0a12 100644 --- a/includes/class-flutterwave-payments.php +++ b/includes/class-flutterwave-payments.php @@ -186,9 +186,9 @@ public function admin_notices() { if ( $no_secret_key || $no_public_key ) { echo ''; } @@ -229,18 +229,18 @@ private static function generate_payment_hash( array $payment_data ) { */ public function get_payment_url() { check_ajax_referer( 'flw-rave-pay-nonce', 'flw_sec_code' ); - $post_data = wp_unslash( $_POST ); - $amount = isset( $post_data['amount'] ) ? sanitize_text_field( $post_data['amount'] ) : null; - $email = isset( $post_data['customer']['email'] ) ? sanitize_email( $post_data['customer']['email'] ) : null; - $country = isset( $post_data['country'] ) ? sanitize_text_field( $post_data['country'] ) : 'NGN'; - $form_id = isset( $post_data['form_id'] ) ? sanitize_text_field( $post_data['form_id'] ) : null; + + $amount = isset( $_POST['amount'] ) ? sanitize_text_field( wp_unslash( $_POST['amount'] ) ) : null; + $email = isset( $_POST['customer']['email'] ) ? sanitize_email( wp_unslash( $_POST['customer']['email'] ) ) : null; + $country = isset( $_POST['country'] ) ? sanitize_text_field( wp_unslash( $_POST['country'] ) ) : 'NGN'; + $form_id = isset( $_POST['form_id'] ) ? sanitize_text_field( wp_unslash( $_POST['form_id'] ) ) : null; $tx_ref = 'WP_' . $form_id . wp_rand( 20, 15003 ) . '_' . time(); - $currency = isset( $post_data['currency'] ) ? sanitize_text_field( $post_data['currency'] ) : null; - $name = isset( $post_data['customer']['name'] ) ? sanitize_text_field( $post_data['customer']['name'] ) : null; - $phone = ( isset( $post_data['customer']['phone_number'] ) ) ? sanitize_text_field( $post_data['customer']['phone_number'] ) : null; - $payment_options = isset( $post_data['payment_options'] ) ? sanitize_text_field( $post_data['payment_options'] ) : null; + $currency = isset( $_POST['currency'] ) ? sanitize_text_field( wp_unslash( $_POST['currency'] ) ) : null; + $name = isset( $_POST['customer']['name'] ) ? sanitize_text_field( wp_unslash( $_POST['customer']['name'] ) ) : null; + $phone = ( isset( $_POST['customer']['phone_number'] ) ) ? sanitize_text_field( wp_unslash( $_POST['customer']['phone_number'] ) ) : null; + $payment_options = isset( $_POST['payment_options'] ) ? sanitize_text_field( wp_unslash( $_POST['payment_options'] ) ) : null; $title = get_bloginfo( 'name' ); - $payment_type = ( isset( $post_data['payment_type'] ) && 'once' !== $post_data['payment_type'] ) ? sanitize_text_field( $post_data['payment_type'] ) : 'once'; + $payment_type = ( isset( $_POST['payment_type'] ) && 'once' !== $_POST['payment_type'] ) ? sanitize_text_field( wp_unslash( $_POST['payment_type'] ) ) : 'once'; $payment_hash_args = array( 'amount' => $amount, diff --git a/includes/class-flw-admin-settings.php b/includes/class-flw-admin-settings.php index 13d0b45..3faca68 100644 --- a/includes/class-flw-admin-settings.php +++ b/includes/class-flw-admin-settings.php @@ -136,7 +136,7 @@ public static function get_instance() { public function flw_rave_add_admin_menu() { add_menu_page( - __( 'Flutterwave Payments', 'flutterwave-payments' ), + __( 'Flutterwave Payments', 'rave-payment-forms' ), 'Flutterwave', 'manage_options', 'flutterwave-payments', @@ -147,8 +147,8 @@ public function flw_rave_add_admin_menu() { add_submenu_page( 'flutterwave-payments', - __( 'Flutterwave Payments Settings', 'flutterwave-payments' ), - __( 'Settings', 'flutterwave-payments' ), + __( 'Flutterwave Payments Settings', 'rave-payment-forms' ), + __( 'Settings', 'rave-payment-forms' ), 'manage_options', 'flutterwave-payments', array( __CLASS__, 'flw_rave_admin_setting_page' ) diff --git a/includes/class-flw-payment-list.php b/includes/class-flw-payment-list.php index b97279d..51fafc3 100644 --- a/includes/class-flw-payment-list.php +++ b/includes/class-flw-payment-list.php @@ -7,8 +7,9 @@ defined( 'ABSPATH' ) || exit; +require_once ABSPATH . 'wp-admin/includes/template.php'; + if ( ! class_exists( 'WP_List_Table' ) ) { - require_once ABSPATH . 'wp-admin/includes/template.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; } @@ -42,8 +43,8 @@ class FLW_Payment_List extends WP_List_Table { public function __construct() { parent::__construct( array( - 'singular' => __( 'Payment List', 'flutterwave-payments' ), - 'plural' => __( 'Payment Lists', 'flutterwave-payments' ), + 'singular' => __( 'Payment List', 'rave-payment-forms' ), + 'plural' => __( 'Payment Lists', 'rave-payment-forms' ), 'ajax' => false, ) ); @@ -61,7 +62,7 @@ public function __construct() { * @return void */ public function no_items() { - esc_html_e( 'No payments have been made yet.', 'flutterwave-payments' ); + esc_html_e( 'No payments have been made yet.', 'rave-payment-forms' ); } /** @@ -138,13 +139,13 @@ public function column_default( $item, $column_name ) { public function get_columns(): array { $columns = array( 'cb' => '', - 'tx_ref' => __( 'Transaction Ref', 'flutterwave-payments' ), - 'customer' => __( 'Customer', 'flutterwave-payments' ), - 'fullname' => __( 'Customer Fullname', 'flutterwave-payments' ), - 'amount' => __( 'Amount', 'flutterwave-payments' ), - 'currency' => __( 'Currency', 'flutterwave-payments' ), - 'status' => __( 'Status', 'flutterwave-payments' ), - 'date' => __( 'Date', 'flutterwave-payments' ), + 'tx_ref' => __( 'Transaction Ref', 'rave-payment-forms' ), + 'customer' => __( 'Customer', 'rave-payment-forms' ), + 'fullname' => __( 'Customer Fullname', 'rave-payment-forms' ), + 'amount' => __( 'Amount', 'rave-payment-forms' ), + 'currency' => __( 'Currency', 'rave-payment-forms' ), + 'status' => __( 'Status', 'rave-payment-forms' ), + 'date' => __( 'Date', 'rave-payment-forms' ), ); return $columns; @@ -204,8 +205,8 @@ public function set_screen( $status, $option, $value ) { public function add_to_menu() { $hook = add_submenu_page( 'flutterwave-payments', - __( 'Transaction List', 'flutterwave-payments' ), - __( 'Transactions', 'flutterwave-payments' ), + __( 'Transaction List', 'rave-payment-forms' ), + __( 'Transactions', 'rave-payment-forms' ), 'manage_options', 'flutterwave-payments-transactions', array( $this, 'payment_list_table' ) @@ -274,8 +275,8 @@ public static function record_count(): int { */ public function add_payment_list_post_type() { $args = array( - 'label' => __( 'Payment Lists', 'flutterwave-payments' ), - 'description' => __( 'Flutterwave payment lists', 'flutterwave-payments' ), + 'label' => __( 'Payment Lists', 'rave-payment-forms' ), + 'description' => __( 'Flutterwave payment lists', 'rave-payment-forms' ), 'supports' => array( 'title', 'author', 'custom-fields' ), 'hierarchical' => false, 'public' => false, diff --git a/includes/class-flw-shortcodes.php b/includes/class-flw-shortcodes.php index 323f29e..61bc0dd 100644 --- a/includes/class-flw-shortcodes.php +++ b/includes/class-flw-shortcodes.php @@ -35,7 +35,7 @@ public function __construct() { * @return string; */ private static function check_settings_for_api_keys() { - $api_key_not_present = __( 'Please configure Flutterwave Payments settings correctly. API keys are still missing.', 'flutterwave-payments' ); + $api_key_not_present = __( 'Please configure Flutterwave Payments settings correctly. API keys are still missing.', 'rave-payment-forms' ); return " Note: " . $api_key_not_present . ''; } @@ -45,7 +45,7 @@ private static function check_settings_for_api_keys() { * @return string; */ private static function check_redirect_urls() { - $api_key_not_present = __( 'Please configure Flutterwave Payments settings correctly. Redirect Urls are missing.', 'flutterwave-payments' ); + $api_key_not_present = __( 'Please configure Flutterwave Payments settings correctly. Redirect Urls are missing.', 'rave-payment-forms' ); return " Note: " . $api_key_not_present . ''; } diff --git a/includes/integrations/class-flw-thirdparty-integrations.php b/includes/integrations/class-flw-thirdparty-integrations.php index e632dc7..11765a7 100644 --- a/includes/integrations/class-flw-thirdparty-integrations.php +++ b/includes/integrations/class-flw-thirdparty-integrations.php @@ -158,8 +158,8 @@ public function get_admin_script() { public function add_admin_menu() { add_submenu_page( 'flutterwave-payments', - __( 'Flutterwave Payments Integrations', 'flutterwave-payments' ), - __( 'Integrations', 'flutterwave-payments' ), + __( 'Flutterwave Payments Integrations', 'rave-payment-forms' ), + __( 'Integrations', 'rave-payment-forms' ), 'manage_options', 'flutterwave-payments-integrations', array( __CLASS__, 'flw_integration_page' ) diff --git a/includes/shortcodes/class-abstract-flw-shortcode.php b/includes/shortcodes/class-abstract-flw-shortcode.php index 513f60c..dc18d9e 100644 --- a/includes/shortcodes/class-abstract-flw-shortcode.php +++ b/includes/shortcodes/class-abstract-flw-shortcode.php @@ -174,56 +174,56 @@ protected function get_field_data_type( ?string $key = null ) { 'name' => 'email', 'class' => 'flw-form-input-text', 'type' => 'text', - 'placeholder' => __( 'Email', 'flutterwave-payments' ), + 'placeholder' => __( 'Email', 'rave-payment-forms' ), ), 'amount' => array( 'id' => 'flw-amount', 'name' => 'amount', 'class' => 'flw-form-input-text', 'type' => 'number', - 'placeholder' => __( 'Amount', 'flutterwave-payments' ), + 'placeholder' => __( 'Amount', 'rave-payment-forms' ), ), 'currency' => array( 'id' => 'flw-currency', 'name' => 'custom_currency', 'class' => 'flw-form-select', 'type' => 'select', - 'label' => __( 'Currency', 'flutterwave-payments' ), + 'label' => __( 'Currency', 'rave-payment-forms' ), ), 'custom_currency' => array( 'id' => 'flw-currency', 'name' => 'custom_currency', 'class' => 'flw-form-select', 'type' => 'select', - 'label' => __( 'Currency', 'flutterwave-payments' ), + 'label' => __( 'Currency', 'rave-payment-forms' ), ), 'fullname' => array( 'id' => 'flw-full-name', 'name' => 'fullname', 'class' => 'flw-form-input-text', 'type' => 'text', - 'placeholder' => __( 'Full Name', 'flutterwave-payments' ), + 'placeholder' => __( 'Full Name', 'rave-payment-forms' ), ), 'phone' => array( 'id' => 'flw-phone', 'name' => 'phone', 'class' => 'flw-form-input-text', 'type' => 'tel', - 'placeholder' => __( 'Phone Number', 'flutterwave-payments' ), + 'placeholder' => __( 'Phone Number', 'rave-payment-forms' ), ), 'firstname' => array( 'id' => 'flw-first-name', 'name' => 'firstname', 'class' => 'flw-form-input-text', 'type' => 'text', - 'placeholder' => __( 'First Name', 'flutterwave-payments' ), + 'placeholder' => __( 'First Name', 'rave-payment-forms' ), ), 'lastname' => array( 'id' => 'flw-last-name', 'name' => 'lastname', 'class' => 'flw-form-input-text', 'type' => 'text', - 'placeholder' => __( 'Last Name', 'flutterwave-payments' ), + 'placeholder' => __( 'Last Name', 'rave-payment-forms' ), ), 'country' => 'text', ); diff --git a/includes/vc-elements/class-flw-vc-simple-form.php b/includes/vc-elements/class-flw-vc-simple-form.php index 1baa79f..fd0c6d2 100644 --- a/includes/vc-elements/class-flw-vc-simple-form.php +++ b/includes/vc-elements/class-flw-vc-simple-form.php @@ -34,20 +34,20 @@ public function flw_simple_form_mapping() { // Map the block with vc_map(). vc_map( array( - 'name' => __( 'Flutterwave Simple Form', 'flutterwave-payments' ), + 'name' => __( 'Flutterwave Simple Form', 'rave-payment-forms' ), 'base' => 'flw-pay-button', - 'description' => __( 'Flutterwave Simple Pay Now Form', 'flutterwave-payments' ), - 'category' => __( 'Flutterwave Forms', 'flutterwave-payments' ), + 'description' => __( 'Flutterwave Simple Pay Now Form', 'rave-payment-forms' ), + 'category' => __( 'Flutterwave Forms', 'rave-payment-forms' ), 'icon' => FLW_DIR_URL . 'assets/images/rave-icon.png', 'params' => array( array( 'type' => 'textfield', 'class' => 'title-class', 'holder' => 'p', - 'heading' => __( 'Amount', 'flutterwave-payments' ), + 'heading' => __( 'Amount', 'rave-payment-forms' ), 'param_name' => 'amount', - 'value' => __('', 'flutterwave-payments'), //phpcs:ignore. - 'description' => __( 'If left blank, user will be asked to enter the amount to complete the payment.', 'flutterwave-payments' ), + 'value' => __('', 'rave-payment-forms'), //phpcs:ignore. + 'description' => __( 'If left blank, user will be asked to enter the amount to complete the payment.', 'rave-payment-forms' ), 'admin_label' => false, 'weight' => 0, 'group' => 'Form Attributes', @@ -55,22 +55,22 @@ public function flw_simple_form_mapping() { array( 'type' => 'checkbox', - 'heading' => __( "Use logged-in user's email?", 'flutterwave-payments' ), - 'description' => __( "Check this if you want the logged-in user's email to be used. If unchecked or user is not logged in, they will be asked to fill in their email address to complete payment.", 'flutterwave-payments' ), + 'heading' => __( "Use logged-in user's email?", 'rave-payment-forms' ), + 'description' => __( "Check this if you want the logged-in user's email to be used. If unchecked or user is not logged in, they will be asked to fill in their email address to complete payment.", 'rave-payment-forms' ), 'param_name' => 'use_current_user_email', 'std' => '', 'value' => array( - __( 'Yes', 'flutterwave-payments' ) => 'yes', + __( 'Yes', 'rave-payment-forms' ) => 'yes', ), 'group' => 'Form Attributes', ), array( 'type' => 'textfield', - 'heading' => __( 'Button Text', 'flutterwave-payments' ), + 'heading' => __( 'Button Text', 'rave-payment-forms' ), 'param_name' => 'content', - 'value' => __('', 'flutterwave-payments'), //phpcs:ignore. - 'description' => __( '(Optional) The text on the PAY NOW button. Default: "PAY NOW"', 'flutterwave-payments' ), + 'value' => __('', 'rave-payment-forms'), //phpcs:ignore. + 'description' => __( '(Optional) The text on the PAY NOW button. Default: "PAY NOW"', 'rave-payment-forms' ), 'admin_label' => false, 'weight' => 0, 'group' => 'Form Attributes', diff --git a/package-lock.json b/package-lock.json index a86e9fe..e031c7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "flutterwave-payments", + "name": "rave-payment-forms", "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "flutterwave-payments", + "name": "rave-payment-forms", "version": "1.0.6", "hasInstallScript": true, "license": "MIT", diff --git a/package.json b/package.json index 6119191..da24b52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "flutterwave-payments", - "version": "1.0.6", + "name": "rave-payment-forms", + "version": "1.0.7", "description": "Official Flutterwave Payment Plugin for WordPress", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ "prebuild": "npm install && composer install", "build": "npm run uglify && composer run makepot && npm run build:webpack && npm run plugin-zip", "build:webpack": "wp-scripts build", - "i18n:merge": "php bin/update-pot-file-references.php i18n/languages/flutterwave-payments.pot", + "i18n:merge": "php bin/update-pot-file-references.php i18n/languages/rave-payment-forms.pot", "start": "npm run start:webpack", "start:webpack": "rimraf build/* && wp-scripts start", "preuglify": "rm -f $npm_package_config_assets_js_min", @@ -41,7 +41,7 @@ "npm": ">=8.15.0" }, "config": { - "wp_org_slug": "flutterwave-payments", + "wp_org_slug": "rave-payment-forms", "assets": { "js": { "min": "assets/js/*.min.js", @@ -69,7 +69,7 @@ "author": "Flutterwave Developers", "license": "MIT", "bugs": { - "url": "https://github.com/bajoski34/Woocommerce-v2/issues" + "url": "https://github.com/bajoski34/WordPress-v2/issues" }, "files": [ "src", @@ -78,14 +78,14 @@ "views", "build", "includes", - "flutterwave-payments.php", + "rave-payment-forms.php", "README.md", "LICENSE", "CHANGELOG.md", "changelog.txt", "readme.txt" ], - "homepage": "https://github.com/bajoski34/Woocommerce-v2#readme", + "homepage": "https://github.com/Flutterwave/WordPress-v2#readme", "devDependencies": { "@automattic/color-studio": "^2.5.0", "@playwright/test": "^1.32.0", diff --git a/phpcs.xml b/phpcs.xml index 3386a89..efb2df3 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -32,7 +32,7 @@ See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035 - + diff --git a/phpunit.xml b/phpunit.xml index 71e3268..884eba7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,7 +11,7 @@ ./includes - ./flutterwave-payments.php + ./rave-payment-forms.php diff --git a/flutterwave-payments.php b/rave-payment-forms.php similarity index 94% rename from flutterwave-payments.php rename to rave-payment-forms.php index 084cd9f..0fc8e9e 100644 --- a/flutterwave-payments.php +++ b/rave-payment-forms.php @@ -3,14 +3,14 @@ * Plugin Name: Flutterwave Payments * Plugin URI: http://flutterwave.com/ * Description: Flutterwave payment gateway forms, accept local and international payments securely. - * Version: 1.0.6 + * Version: 1.0.7 * Requires at least: 5.2 * Requires PHP: 7.4 * Author: Flutterwave Developers * Author URI: https://developer.flutterwave.com/ * Copyright: © 2023 Flutterwave Technology Solutions * License: MIT License - * Text Domain: flutterwave-payments + * Text Domain: rave-payment-forms * Domain Path: i18n/languages * Requires at least: 5.6 * Requires PHP: 7.4 @@ -31,4 +31,3 @@ $flw_pay_class = Flutterwave_Payments::get_instance(); } - diff --git a/readme.txt b/readme.txt index d744098..b8e20bf 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: flutterwave Tags: rave, payment form, payment gateway, bank account, credit card, debit card, nigeria, kenya, international, mastercard, visa, flutterwave Donate link: http://rave.flutterwave.com/ Requires at least: 4.4 -Tested up to: 6.0 +Tested up to: 6.3 Requires PHP: 7.4 -Stable tag: 1.0.6 +Stable tag: 1.0.7 License: MIT License URI: https://github.com/Flutterwave/rave-payment-forms/blob/master/LICENSE @@ -179,4 +179,4 @@ v 1.0.0 v1.0.1 - 12-02-2018 * This version doesn't redirect after failure, it allows the customer try payment again. * This version allows you use multiple currencies on the Wordpress payment form. -* This version now has recurring payments. \ No newline at end of file +* This version now has recurring payments. diff --git a/src/API/class-handler.php b/src/API/class-handler.php index d84f30d..355e733 100644 --- a/src/API/class-handler.php +++ b/src/API/class-handler.php @@ -39,8 +39,8 @@ public static function handle_api_errors( $response ) { */ public static function get_error_hash_table(): array { return array( - 500 => new \WP_Error( 'flw-unavailable', __( 'This Services are Currently Unavailable. Please contact support.', 'flutterwave-payments' ) ), - 401 => new \WP_Error( 'flw-unauthorized', __( 'You do not have the right permission to this service. please ensure your secret_key has been supplied.', 'flutterwave-payments' ) ), + 500 => new \WP_Error( 'flw-unavailable', __( 'This Services are Currently Unavailable. Please contact support.', 'rave-payment-forms' ) ), + 401 => new \WP_Error( 'flw-unauthorized', __( 'You do not have the right permission to this service. please ensure your secret_key has been supplied.', 'rave-payment-forms' ) ), ); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index fd47c5e..8be757e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -37,7 +37,7 @@ function _manually_load_plugin() { // sample here: https://github.com/bajoski34/Woocommerce/blob/master/tests/bootstrap.php#L37 . $_plugin_dir = __DIR__ . '/../'; - require $_plugin_dir . 'flutterwave-payments.php'; + require $_plugin_dir . 'rave-payment-forms.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); diff --git a/tests/manual/manual-tests.md b/tests/manual/manual-tests.md index b40398c..2f32566 100644 --- a/tests/manual/manual-tests.md +++ b/tests/manual/manual-tests.md @@ -1,7 +1,7 @@ ## Activate ``` -start_path: /wp-admin/plugins.php?plugin_status=search&s=flutterwave-payments +start_path: /wp-admin/plugins.php?plugin_status=search&s=rave-payment-forms ``` If you have activated the plugin skip this step. diff --git a/views/admin-integrations-page.php b/views/admin-integrations-page.php index 9d95e06..5dc88b8 100644 --- a/views/admin-integrations-page.php +++ b/views/admin-integrations-page.php @@ -27,7 +27,7 @@ echo "
" . esc_attr( $service->get_info()['name'] ) . '
'; echo "
" . 'Trusted by over 1 million developers for secure and scalable REST APIs. All APIs have a free plan . No credit card required.' . '
'; - echo ''; + echo ''; echo ''; } echo ''; diff --git a/views/admin-settings-page.php b/views/admin-settings-page.php index 668ac80..5a01533 100644 --- a/views/admin-settings-page.php +++ b/views/admin-settings-page.php @@ -23,7 +23,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -55,11 +55,11 @@ - +

-

Flutterwave Account +
Flutterwave Account

@@ -67,14 +67,14 @@ - +
get_option_value( 'go_live' ) ); ?>
@@ -82,7 +82,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -246,14 +246,14 @@ - +
get_option_value( 'theme_style' ) ); ?>

Override the form style and use the default theme's style

diff --git a/views/donation-payment.php b/views/donation-payment.php index 19e55d8..ff7c108 100644 --- a/views/donation-payment.php +++ b/views/donation-payment.php @@ -30,26 +30,26 @@
- -
+ +
- -
+ +
- -
+ +
- +
+ +
- +