Skip to content

Commit

Permalink
rename plugin text domain according to wp standard
Browse files Browse the repository at this point in the history
  • Loading branch information
carlHandy committed Oct 12, 2024
1 parent 43e30c9 commit 2f29e93
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ NEW_VERSION=$(echo $GITHUB_REF | cut -d / -f 3)
# Remove the 'v' prefix if present
NEW_VERSION=${NEW_VERSION#v}

# Update the version in main.php (both in the comment block and in the body)
sed -i "s/\([ *]*Version:[ ]*\)[0-9.]\+/\1$NEW_VERSION/" main.php
sed -i "s/\(define('MMG_PLUGIN_VERSION', '\)[0-9.]\+/\1$NEW_VERSION/" main.php
# Update the version in kalpa-mmg-checkou.php (both in the comment block and in the body)
sed -i "s/\([ *]*Version:[ ]*\)[0-9.]\+/\1$NEW_VERSION/" kalpa-mmg-checkout.php
sed -i "s/\(define('MMG_PLUGIN_VERSION', '\)[0-9.]\+/\1$NEW_VERSION/" kalpa-mmg-checkou.php
# Update the Stable tag in README.txt
sed -i "s/\(Stable tag: \)[0-9.]\+/\1$NEW_VERSION/" README.txt

git add README.txt main.php
git add README.txt kalpa-mmg-checkou.php
git commit -m "Bump version to $NEW_VERSION"

# Push the change to the main branch
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Update version in main.php
- name: Update version in kalpa-mmg-checkout.php
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
run: composer install --no-dev --optimize-autoloader

- name: Zip project
run: zip -r mmg-checkout-payment.zip main.php LICENSE.txt uninstall.php vendor/* README.txt admin/* public/* includes/*
run: zip -r kalpa-mmg-checkout.zip kalpa-mmg-checkout.php LICENSE.txt uninstall.php vendor/* README.txt admin/* public/* includes/*

- name: Setup GitHub CLI
uses: actions/setup-go@v4
Expand All @@ -63,4 +63,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./mmg-checkout-payment.zip --clobber
gh release upload ${{ github.ref_name }} ./kalpa-mmg-checkout.zip --clobber
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Developer Contribution Guide


## Project Overview

MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to provide a secure payment gateway for MMG Merchants. This guide is for developers who want to contribute to the project.
MMG Checkout for WooCommerce is a WordPress plugin that integrates with WooCommerce to provide a secure payment gateway for MMG Merchants. This guide is for developers who want to contribute to the project.

## Development Prerequisites

Expand All @@ -24,7 +23,7 @@ MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to p
git clone https://github.com/Kalpa-Services/mmg-wp-plugin.git
```
1. Navigate to project directory. Doing so should automatically install all the required environment dependencies. If not run `devbox install`.
2. Run `composer install` project dependencies.
1. Run `composer install` project dependencies.
1. Run `devbox services up` to start all services.
1. Run `mysql -u root` to connect to the database and create a new database for wordpress.
1. Create a new directory called `wordpress` in `devbox.d` and run the following commands inside it:
Expand All @@ -40,7 +39,7 @@ MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to p
1. Navigae to `devbox.d/wordpress/wp-content/plugins` and run the following command:

```sh
ln -s /path/to/project/mmg-wp-plugin mmg-checkout-payment
ln -s /path/to/project/mmg-wp-plugin kalpa-mmg-checkout
```

1. Activate plugin in the WordPress admin panel.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MMG Checkout Payment Plugin - Developer Contribution Guide
# MMG Checkout for WooCommerce Plugin - Developer Contribution Guide

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FKalpa-Services%2Fmmg-wp-plugin.svg?type=shield&issueType=security)](https://app.fossa.com/projects/git%2Bgithub.com%2FKalpa-Services%2Fmmg-wp-plugin?ref=badge_shield&issueType=security)

## Project Overview

MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to provide a secure payment gateway for MMG Merchants. This guide is for developers who want to contribute to the project.
MMG Checkout for WooCommerce is a WordPress plugin that integrates with WooCommerce to provide a secure payment gateway for MMG Merchants. This guide is for developers who want to contribute to the project.

## Development Prerequisites

Expand All @@ -25,7 +25,7 @@ MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to p
git clone https://github.com/Kalpa-Services/mmg-wp-plugin.git
```
1. Navigate to project directory. Doing so should automatically install all the required environment dependencies. If not run `devbox install`.
2. Run `composer install` project dependencies.
1. Run `composer install` project dependencies.
1. Run `devbox services up` to start all services.
1. Run `mysql -u root` to connect to the database and create a new database for wordpress.
1. Create a new directory called `wordpress` in `devbox.d` and run the following commands inside it:
Expand All @@ -41,7 +41,7 @@ MMG Checkout Payment is a WordPress plugin that integrates with WooCommerce to p
1. Navigae to `devbox.d/wordpress/wp-content/plugins` and run the following command:

```sh
ln -s /path/to/project/mmg-wp-plugin mmg-checkout-payment
ln -s /path/to/project/mmg-wp-plugin kalpa-mmg-checkout
```

1. Activate plugin in the WordPress admin panel.
Expand Down
12 changes: 6 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== MMG Checkout Payment for WooCommerce ===
=== MMG Checkout for WooCommerce for WooCommerce ===
Contributors: kalpaservices
Tags: woocommerce, payment gateway, mmg, checkout
Requires at least: 5.6
Expand All @@ -8,11 +8,11 @@ Stable tag: 2.1.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Enables MMG Checkout Payment flow for registered MMG Merchants to receive E-Commerce payments from MMG customers.
Enables MMG Checkout for WooCommerce flow for registered MMG Merchants to receive E-Commerce payments from MMG customers.

== Description ==

MMG Checkout Payment is a WordPress plugin that enables MMG Checkout Payment flow for registered MMG Merchants to receive E-Commerce payments from MMG customers. This plugin integrates seamlessly with WooCommerce to provide a secure and efficient payment gateway for your online store.
MMG Checkout for WooCommerce is a WordPress plugin that enables MMG Checkout for WooCommerce flow for registered MMG Merchants to receive E-Commerce payments from MMG customers. This plugin integrates seamlessly with WooCommerce to provide a secure and efficient payment gateway for your online store.

Key Features:
* Easy integration with WooCommerce
Expand All @@ -27,7 +27,7 @@ Key Features:

1. Log in to your WordPress admin panel.
2. Navigate to 'Plugins' -> 'Add New'.
3. In the search box, type "MMG Checkout Payment for WooCommerce".
3. In the search box, type " MMG Checkout for WooCommerce for WooCommerce".
4. Look for the plugin in the search results and click "Install Now".
5. After installation, click "Activate" to enable the plugin.
6. Configure the plugin settings in the WordPress admin area under 'Settings' > 'MMG Checkout'.
Expand Down Expand Up @@ -82,8 +82,8 @@ This version includes important updates and improvements. Please upgrade to ensu

== Screenshots ==

1. MMG Checkout Payment gateway settings page
![MMG Checkout Payment gateway settings page](public/images/settings-page.png)
1. MMG Checkout for WooCommerce gateway settings page
![ MMG Checkout for WooCommerce gateway settings page](public/images/settings-page.png)

2. MMG Checkout option on WooCommerce checkout page
![MMG Checkout option on WooCommerce checkout page](public/images/checkout-options.png)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* MMG Checkout Payment Activator
* MMG Checkout for WooCommerce Activator
*
* This file contains the MMG_Checkout_Payment_Activator class and activation function.
*
* @package MMG_Checkout_Payment
* @package Kalpa_MMG_Checkout_Payment
* @since 1.0.0
*/

Expand All @@ -18,7 +18,7 @@
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.0.0
* @package MMG_Checkout_Payment
* @package Kalpa_MMG_Checkout_Payment
* @author Kalpa Services Inc. <[email protected]>
*/
class MMG_Checkout_Payment_Activator {
Expand Down Expand Up @@ -46,9 +46,9 @@ private static function mmg_activate() {
}

/**
* Add rewrite rules for MMG Checkout Payment callbacks.
* Add rewrite rules for MMG Checkout for WooCommerce callbacks.
*
* This function adds a rewrite rule to handle MMG Checkout Payment callbacks
* This function adds a rewrite rule to handle MMG Checkout for WooCommerce callbacks
* through a custom endpoint.
*/
private static function add_rewrite_rules() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* MMG Checkout Payment Deactivator
* MMG Checkout for WooCommerce Deactivator
*
* This file contains the MMG_Checkout_Payment_Deactivator class and deactivation function.
*
* @package MMG_Checkout_Payment
* @package Kalpa_MMG_Checkout_Payment
* @since 1.0.0
*/

Expand All @@ -16,7 +16,7 @@
* Fired during plugin deactivation
*
* @since 1.0.0
* @package MMG Checkout Payment
* @package MMG Checkout for WooCommerce
* @author Kalpa Services Inc. <[email protected]>
*/
class MMG_Checkout_Payment_Deactivator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* This file contains the MMG_Dependency_Checker class which checks for required dependencies.
*
* @package MMG_Checkout
* @package Kalpa_MMG_Checkout
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* This class defines the MMG payment gateway for WooCommerce.
*
* @package MMG_Checkout
* @package Kalpa_MMG_Checkout
*/

/**
Expand All @@ -19,7 +19,7 @@ public function __construct() {
$this->id = 'mmg_checkout';
$this->has_fields = false;
$this->method_title = 'MMG Checkout';
$this->method_description = 'Enables MMG Checkout Payment flow for WooCommerce';
$this->method_description = 'Enables MMG Checkout for WooCommerce';

$this->init_form_fields();
$this->init_settings();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* MMG Checkout Payment Class
* MMG Checkout for WooCommerce Class
*
* This class handles the payment processing for MMG Checkout.
*
* @package MMG_Checkout
* @package Kalpa_MMG_Checkout
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand Down Expand Up @@ -81,7 +81,7 @@ public function __construct() {
$this->callback_url = $this->generate_unique_callback_url();

// Load settings.
require_once __DIR__ . '/class-mmg-checkout-settings.php';
require_once __DIR__ . '/class-kalpa-mmg-checkout-settings.php';
new MMG_Checkout_Settings();

add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
Expand Down Expand Up @@ -292,7 +292,7 @@ public function add_gateway_class( $gateways ) {
*/
public function init_gateway_class() {
if ( class_exists( 'WC_Payment_Gateway' ) ) {
require_once __DIR__ . '/class-wc-mmg-gateway.php';
require_once __DIR__ . '/class-kalpa-mmg-checkout-gateway.php';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/**
* MMG Payments Blocks Integration
*
* Integrates MMG Checkout payment method with WooCommerce Blocks.
* Integrates MMG Checkout for WooCommerce method with WooCommerce Blocks.
*
* @package MMG_Checkout
* @package Kalpa_MMG_Checkout
*/

use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* This class handles the settings page for the MMG Checkout plugin.
*
* @package MMG_Checkout_Payment
* @package Kalpa_MMG_Checkout_Payment
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
33 changes: 16 additions & 17 deletions main.php → kalpa-mmg-checkout.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php
/**
* Plugin Name: MMG Checkout Payment
* Plugin Name: MMG Checkout for WooCommerce
*
* @package MMG Checkout Payment
* @package MMG Checkout for WooCommerce
* @author Kalpa Services Inc.
* @copyright 2024 Kalpa Services Inc.
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: MMG Checkout Payment
* Plugin Name: MMG Checkout for WooCommerce
* Plugin URI: https://mmg-plugin.kalpa.dev
* Description: Enables MMG Checkout Payment flow for registered MMG Merchants to receive E-Commerce payments from MMG customers.
* Description: Enables MMG Checkout for WooCommerce flow for registered MMG Merchants to receive E-Commerce payments from MMG customers.
* Version: 2.1.7
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Kalpa Services Inc.
* Author URI: https://kalpa.dev
* Text Domain: mmg-checkout-payment
* Text Domain: kalpa-mmg-checkout
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Requires Plugins: woocommerce
Expand All @@ -28,30 +28,29 @@

define( 'MMG_PLUGIN_VERSION', '2.0.0' );
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-dependency-checker.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-dependency-checker.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-checkout-payment-activator.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-checkout-payment-deactivator.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-checkout-payment-deactivator.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-dependency-checker.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-activator.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-deactivator.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-deactivator.php';
// This is temporary until the plugin is uploaded to the WordPress repository.
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

$update_checker = PucFactory::buildUpdateChecker(
'https://github.com/Kalpa-Services/mmg-wp-plugin/',
__FILE__,
'mmg-checkout-payment'
'kalpa-mmg-checkout'
);
$update_checker->getVcsApi()->enableReleaseAssets();

if ( MMG_Dependency_Checker::check_dependencies() ) {
/**
* Initialize the MMG Checkout Payment functionality.
* Initialize the MMG Checkout for WooCommerce functionality.
*
* This function is called when all plugins are loaded and dependencies are met.
* It includes the main plugin class and instantiates it.
*/
function mmg_checkout_init() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-checkout-payment.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-main.php';
new MMG_Checkout_Payment();
}
add_action( 'plugins_loaded', 'mmg_checkout_init' );
Expand All @@ -60,14 +59,14 @@ function mmg_checkout_init() {
add_action( 'woocommerce_blocks_loaded', 'mmg_checkout_register_block_support' );

/**
* Register MMG Checkout Payment support for WooCommerce Blocks.
* Register MMG Checkout for WooCommerce support for WooCommerce Blocks.
*
* This function checks if the WooCommerce Blocks abstract payment method class exists,
* and if so, registers the MMG Payments Block support.
*/
function mmg_checkout_register_block_support() {
if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wc-mmg-payments-blocks.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-kalpa-mmg-checkout-payments-blocks.php';
add_action(
'woocommerce_blocks_payment_method_type_registration',
function ( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
Expand All @@ -77,7 +76,7 @@ function ( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment
}
}
/**
* Add custom query variables for MMG Checkout Payment.
* Add custom query variables for MMG Checkout for WooCommerce.
*
* @param array $vars The array of existing query variables.
* @return array The updated array of query variables.
Expand Down Expand Up @@ -105,7 +104,7 @@ function mmg_plugin_updated() {
add_action( 'plugins_loaded', 'mmg_plugin_updated' );

/**
* Remove the MMG Checkout Payment gateway from the list of available gateways.
* Remove the MMG Checkout for WooCommerce gateway from the list of available gateways.
*
* @param array $gateways The array of registered payment gateways.
* @return array The updated array of payment gateways.
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<description>WordPress Coding Standards</description>
<rule ref="WordPress" />
<file>./includes</file>
<file>main.php</file>
<file>kalpa-mmg-checkou.php</file>
<file>uninstall.php</file>
</ruleset>
2 changes: 1 addition & 1 deletion uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @link https://github.com/kalpa-services/mmg-wp-plugin
* @since 1.0.0
*
* @package MMG Checkout Payment
* @package MMG Checkout for WooCommerce
*/

// If uninstall not called from WordPress, then exit.
Expand Down

0 comments on commit 2f29e93

Please sign in to comment.