Skip to content

Commit a734c90

Browse files
authored
Update chip-for-fluent-forms.php (#4)
* Update chip-for-fluent-forms.php Fix issue "Function _load_textdomain_just_in_time was called incorrectly" * Bump stable version to 1.1.2 * Fix indentation * Add json file
2 parents 6684eca + d8f8b76 commit a734c90

17 files changed

+1331
-1154
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.vscode export-ignore
2+
*.md export-ignore
3+
.gitignore export-ignore
4+
/.gitattributes export-ignore
5+
/.github export-ignore
6+
/composer.json export-ignore
7+
/composer.lock export-ignore
8+
/package.json export-ignore
9+
/package-lock.json export-ignore

.github/workflows/build-zip.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build release zip
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: Build release zip
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Build plugin # Remove or modify this step as needed
18+
run: |
19+
composer install --no-dev
20+
npm install
21+
# npm run build
22+
23+
- name: Generate zip
24+
uses: 10up/action-wordpress-plugin-build-zip@stable
25+
with:
26+
retention-days: 5 # Optional; defaults to 5
27+
env:
28+
SLUG: chip-for-fluent-forms
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Plugin Activation Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
activation-test:
11+
name: Test Plugin Activation
12+
runs-on: ubuntu-latest
13+
services:
14+
mysql:
15+
image: mariadb:latest
16+
ports:
17+
- '3306:3306'
18+
env:
19+
MYSQL_ROOT_PASSWORD: wordpress
20+
MARIADB_INITDB_SKIP_TZINFO: 1
21+
MYSQL_USER: wordpress
22+
MYSQL_PASSWORD: wordpress
23+
MYSQL_DATABASE: wordpress_test
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
coverage: none
31+
php-version: "8.2"
32+
33+
- name: Install PHP Dependencies
34+
uses: ramsey/composer-install@v3
35+
36+
- name: Install Subversion (SVN)
37+
run: sudo apt-get install -y subversion
38+
39+
- name: Set up WordPress and WordPress Test Library
40+
uses: sjinks/setup-wordpress-test-library@master
41+
with:
42+
version: latest
43+
44+
- name: Install WP-CLI
45+
run: |
46+
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
47+
chmod +x wp-cli.phar
48+
sudo mv wp-cli.phar /usr/local/bin/wp
49+
wp config create --force --dbname=wordpress_test --dbuser=wordpress --dbpass=wordpress --dbhost=127.0.0.1 --path=/tmp/wordpress
50+
wp core install --url=http://localhost --title=test --admin_user=wzul [email protected] --path=/tmp/wordpress
51+
- name: Copy plugin to WordPress
52+
run: |
53+
mkdir -p /tmp/wordpress/wp-content/plugins/chip-for-fluent-forms
54+
rsync -av --exclude='.git' . /tmp/wordpress/wp-content/plugins/chip-for-fluent-forms/
55+
56+
- name: Test plugin activation
57+
run: |
58+
wp plugin activate chip-for-fluent-forms --path=/tmp/wordpress

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
**/.DS_Store
2+
composer.lock
3+
/vendor

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
== Changelog ==
22

3+
= 1.1.2 2025-05-05 =
4+
* Fixed - Fixed issue with load_textdomain.
5+
6+
= 1.1.1 2024-08-21 =
7+
* Fixed - Fix settings link.
8+
39
= 1.1.0 2024-04-29 =
410
* Added - Duitnow QR in payment method whitelist option.
511
* Changed - Updated CSF.

chip-for-fluent-forms.php

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,94 @@
1-
<?php
1+
<?php
2+
23
/**
34
*
45
* Plugin Name: CHIP for Fluent Forms
56
* Plugin URI: https://wordpress.org/plugins/chip-for-fluent-forms/
67
* Description: CHIP - Digital Finance Platform
7-
* Version: 1.1.1
8+
* Version: 1.1.2
89
* Author: Chip In Sdn Bhd
910
* Author URI: http://www.chip-in.asia
11+
* Requires PHP: 7.4
12+
* Requires at least: 6.1
1013
*
11-
* Copyright: © 2024 CHIP
14+
* Copyright: © 2025 CHIP
1215
* License: GNU General Public License v3.0
1316
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
14-
*
1517
*/
1618

17-
if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
19+
if ( ! defined( 'ABSPATH' ) ) {
20+
die; } // Cannot access directly.
1821

19-
define('FF_CHIP_MODULE_VERSION', 'v1.1.1');
22+
define( 'FF_CHIP_MODULE_VERSION', 'v1.1.2' );
2023

2124
class Chip_Fluent_Forms {
2225

23-
private static $_instance;
24-
25-
public static function get_instance() {
26-
if ( self::$_instance == null ) {
27-
self::$_instance = new self();
28-
}
29-
30-
return self::$_instance;
31-
}
32-
33-
public function __construct() {
34-
$this->define();
35-
$this->includes();
36-
$this->add_filters();
37-
$this->add_actions();
38-
}
39-
40-
public function define() {
41-
define( 'FF_CHIP_FILE', __FILE__ );
42-
define( 'FF_CHIP_BASENAME', plugin_basename(FF_CHIP_FILE));
43-
define( 'FF_CHIP_FSLUG', 'fluent_form_chip');
44-
}
45-
46-
public function includes() {
47-
$includes_dir = plugin_dir_path( FF_CHIP_FILE ) . 'includes/';
48-
include $includes_dir . 'class-api.php';
49-
include $includes_dir . 'codestar-framework/classes/setup.class.php';
50-
51-
if ( is_admin() ){
52-
include $includes_dir . 'admin/global-settings.php';
53-
include $includes_dir . 'admin/form-settings.php';
54-
include $includes_dir . 'admin/backup-settings.php';
55-
include $includes_dir . 'admin/class-webhook-setup.php';
56-
}
57-
58-
include $includes_dir . 'class-register.php';
59-
include $includes_dir . 'class-purchase.php';
60-
}
61-
62-
public function add_filters() {
63-
add_filter( 'plugin_action_links_' . FF_CHIP_BASENAME, array( $this, 'setting_link' ) );
64-
}
65-
66-
public function add_actions() {
67-
68-
}
69-
70-
public function setting_link($links) {
71-
$new_links = array(
72-
'settings' => sprintf(
73-
'<a href="%1$s">%2$s</a>', admin_url('admin.php?page=chip-for-fluent-forms'), esc_html__('Settings', 'chip-for-fluent-forms')
74-
)
75-
);
76-
77-
return array_merge($new_links, $links);
78-
}
26+
private static $_instance;
27+
28+
public static function get_instance() {
29+
if ( self::$_instance == null ) {
30+
self::$_instance = new self();
31+
}
32+
33+
return self::$_instance;
34+
}
35+
36+
public function __construct() {
37+
$this->define();
38+
$this->includes();
39+
$this->add_filters();
40+
$this->add_actions();
41+
}
42+
43+
public function define() {
44+
define( 'FF_CHIP_FILE', __FILE__ );
45+
define( 'FF_CHIP_BASENAME', plugin_basename( FF_CHIP_FILE ) );
46+
define( 'FF_CHIP_FSLUG', 'fluent_form_chip' );
47+
}
48+
49+
public function includes() {
50+
$includes_dir = plugin_dir_path( FF_CHIP_FILE ) . 'includes/';
51+
include $includes_dir . 'class-api.php';
52+
include $includes_dir . 'codestar-framework/classes/setup.class.php';
53+
54+
if ( is_admin() ) {
55+
include $includes_dir . 'admin/global-settings.php';
56+
include $includes_dir . 'admin/form-settings.php';
57+
include $includes_dir . 'admin/backup-settings.php';
58+
include $includes_dir . 'admin/class-webhook-setup.php';
59+
}
60+
61+
include $includes_dir . 'class-register.php';
62+
include $includes_dir . 'class-purchase.php';
63+
}
64+
65+
public function add_filters() {
66+
add_filter( 'plugin_action_links_' . FF_CHIP_BASENAME, array( $this, 'setting_link' ) );
67+
}
68+
69+
public function add_actions() {
70+
}
71+
72+
public function setting_link( $links ) {
73+
$new_links = array(
74+
'settings' => sprintf(
75+
'<a href="%1$s">%2$s</a>',
76+
admin_url( 'admin.php?page=chip-for-fluent-forms' ),
77+
esc_html__( 'Settings', 'chip-for-fluent-forms' )
78+
),
79+
);
80+
81+
return array_merge( $new_links, $links );
82+
}
7983
}
8084

81-
add_action( 'plugins_loaded', 'load_chip_for_fluent_forms' );
85+
add_action( 'init', 'load_chip_for_fluent_forms', 0 );
8286

8387
function load_chip_for_fluent_forms() {
8488

85-
if ( !class_exists( 'FluentFormPro\Payments\PaymentHelper' ) && !class_exists( 'FluentFormPro\Payments\PaymentMethods\BaseProcessor' ) ) {
86-
return;
87-
}
89+
if ( ! class_exists( 'FluentFormPro\Payments\PaymentHelper' ) && ! class_exists( 'FluentFormPro\Payments\PaymentMethods\BaseProcessor' ) ) {
90+
return;
91+
}
8892

89-
Chip_Fluent_Forms::get_instance();
93+
Chip_Fluent_Forms::get_instance();
9094
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

includes/admin/backup-settings.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
$slug = FF_CHIP_FSLUG;
44

5-
CSF_Setup::createSection( $slug, array(
6-
'id' => 'backup-restore',
7-
'title' => __( 'Backup and Restore', 'chip-for-fluent-forms' ),
8-
'icon' => 'fa fa-copy',
9-
'description' => __( 'Backup and Restore your configuration.', 'chip-for-fluent-forms' ),
10-
'fields' => array(
11-
array(
12-
'id' => 'backup',
13-
'type' => 'backup',
14-
),
15-
)
16-
));
5+
CSF_Setup::createSection(
6+
$slug,
7+
array(
8+
'id' => 'backup-restore',
9+
'title' => __( 'Backup and Restore', 'chip-for-fluent-forms' ),
10+
'icon' => 'fa fa-copy',
11+
'description' => __( 'Backup and Restore your configuration.', 'chip-for-fluent-forms' ),
12+
'fields' => array(
13+
array(
14+
'id' => 'backup',
15+
'type' => 'backup',
16+
),
17+
),
18+
)
19+
);

0 commit comments

Comments
 (0)