+
Sign out)', 'wp-user-frontend' ) ),
+ __( 'Hello %1$s, (not %1$s? Sign out)', 'wp-user-frontend' ) ),
'' . esc_html( $current_user->display_name ) . '',
esc_url( wp_logout_url( get_permalink() ) )
);
@@ -41,11 +41,11 @@
}
if ( $total_tabs == $count ) {
- $links .= ' ' . esc_html( $label ) . '';
+ $links .= ' ' . esc_html( $label ) . '';
continue;
}
- $links .= '' . esc_html( $label ) . ', ';
+ $links .= '' . esc_html( $label ) . ', ';
$count++;
}
diff --git a/templates/dashboard/posts.php b/templates/dashboard/posts.php
index 51a761905..b80567fd2 100644
--- a/templates/dashboard/posts.php
+++ b/templates/dashboard/posts.php
@@ -179,13 +179,13 @@
-
+ |
post_status;
wpuf_show_post_status( $current_post_status );
?>
|
-
+ |
-
+
|
@@ -380,12 +380,12 @@ class="wpuf-pagination-link !wpuf-inline-flex !wpuf-items-center !wpuf-px-3 !wpu
+ class="!wpuf-relative !wpuf-inline-flex !wpuf-items-center !wpuf-px-4 !wpuf-py-2 !wpuf-text-sm !wpuf-font-medium !wpuf-text-emerald-600 !wpuf-border-t-2 !wpuf-border-emerald-600">
diff --git a/templates/dashboard/subscription.php b/templates/dashboard/subscription.php
index f606ccbe0..a19db52fd 100644
--- a/templates/dashboard/subscription.php
+++ b/templates/dashboard/subscription.php
@@ -188,9 +188,7 @@ function get_next_billing_html( $subscription_data ) {
@@ -250,6 +248,8 @@ function get_next_billing_html( $subscription_data ) {
+
+
/year
diff --git a/vite.config.mjs b/vite.config.mjs
index 3ecef8fe6..5a5b90541 100644
--- a/vite.config.mjs
+++ b/vite.config.mjs
@@ -2,8 +2,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const entries = {
- 'subscriptions': './assets/js/subscriptions.js',
- 'frontend-subscriptions': './assets/js/frontend-subscriptions.js',
+ 'frontend-subscriptions': './assets/js/frontend-subscriptions.js',
'forms-list': './assets/js/forms-list.js',
'account': './assets/js/account.js',
'ai-form-builder': './assets/js/ai-form-builder.js',
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 000000000..f55ba25fc
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,39 @@
+const defaultConfig = require('@wordpress/scripts/config/webpack.config');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const RtlCssPlugin = require('rtlcss-webpack-plugin');
+const path = require('path');
+
+module.exports = {
+ ...defaultConfig,
+ entry: {
+ 'subscriptions': path.resolve(process.cwd(), 'src/js/subscriptions.jsx'),
+ },
+ output: {
+ filename: 'js/[name].min.js',
+ path: path.resolve(process.cwd(), 'assets'),
+ },
+ plugins: [
+ ...defaultConfig.plugins.filter(
+ (plugin) =>
+ plugin.constructor.name !== 'MiniCssExtractPlugin' &&
+ plugin.constructor.name !== 'RtlCssPlugin' &&
+ plugin.constructor.name !== 'CleanWebpackPlugin'
+ ),
+ new MiniCssExtractPlugin({
+ filename: 'css/[name].css',
+ }),
+ new RtlCssPlugin({
+ filename: 'css/[name]-rtl.css',
+ }),
+ ],
+ watchOptions: {
+ ignored: ['**/assets/js/**', '**/assets/css/**', '**/node_modules/**'],
+ },
+ resolve: {
+ ...defaultConfig.resolve,
+ alias: {
+ ...defaultConfig.resolve.alias,
+ 'postcss-config$': path.resolve(__dirname, 'postcss.config.react.js'),
+ },
+ },
+};
diff --git a/wpuf.php b/wpuf.php
index 4a04412d4..f7f19ea65 100644
--- a/wpuf.php
+++ b/wpuf.php
@@ -13,7 +13,7 @@
*/
// don't call the file directly
-if ( ! defined( 'ABSPATH' ) ) {
+if ( !defined( 'ABSPATH' ) ) {
exit;
}
@@ -30,6 +30,11 @@
define( 'WPUF_ASSET_URI', WPUF_ROOT_URI . '/assets' );
define( 'WPUF_INCLUDES', WPUF_ROOT . '/includes' );
+// Feature flag for React subscriptions (set to true in wp-config.php to enable)
+if ( !defined( 'WPUF_USE_REACT_SUBSCRIPTIONS' ) ) {
+ define( 'WPUF_USE_REACT_SUBSCRIPTIONS', true );
+}
+
use WeDevs\WpUtils\SingletonTrait;
/**
@@ -72,7 +77,7 @@ final class WP_User_Frontend {
* Fire up the plugin
*/
public function __construct() {
- if ( ! $this->is_supported_php() ) {
+ if ( !$this->is_supported_php() ) {
add_action( 'admin_notices', [ $this, 'php_version_notice' ] );
return;
@@ -108,11 +113,11 @@ public function is_supported_php( $min_php = null ) {
* @return void
*/
public function php_version_notice() {
- if ( $this->is_supported_php() || ! current_user_can( 'manage_options' ) ) {
+ if ( $this->is_supported_php() || !current_user_can( 'manage_options' ) ) {
return;
}
- $error = __( 'Your installed PHP Version is: ', 'wp-user-frontend' ) . PHP_VERSION . '. ';
+ $error = __( 'Your installed PHP Version is: ', 'wp-user-frontend' ) . PHP_VERSION . '. ';
$error .= __( 'The
WP User Frontend plugin requires PHP version
', 'wp-user-frontend' ) . $this->min_php . __( ' or greater.', 'wp-user-frontend' ); ?>
@@ -144,7 +149,7 @@ public function init_hooks() {
public function init_insights() {
// Insight class instantiate
- $this->container['tracker'] = new WeDevs\Wpuf\Lib\WeDevs_Insights( __FILE__ );
+ $this->container[ 'tracker' ] = new WeDevs\Wpuf\Lib\WeDevs_Insights( __FILE__ );
}
/**
@@ -157,7 +162,7 @@ public function includes() {
require_once __DIR__ . '/includes/class-frontend-render-form.php';
// add reCaptcha library if not found
- if ( ! function_exists( 'recaptcha_get_html' ) ) {
+ if ( !function_exists( 'recaptcha_get_html' ) ) {
require_once __DIR__ . '/Lib/recaptchalib.php';
require_once __DIR__ . '/Lib/invisible_recaptcha.php';
}
@@ -175,29 +180,29 @@ public function includes() {
* @return void
*/
public function instantiate() {
- $this->container['assets'] = new WeDevs\Wpuf\Assets();
- $this->container['subscription'] = new WeDevs\Wpuf\Admin\Subscription();
- $this->container['fields'] = new WeDevs\Wpuf\Admin\Forms\Field_Manager();
- $this->container['customize'] = new WeDevs\Wpuf\Admin\Customizer_Options();
+ $this->container[ 'assets' ] = new WeDevs\Wpuf\Assets();
+ $this->container[ 'subscription' ] = new WeDevs\Wpuf\Admin\Subscription();
+ $this->container[ 'fields' ] = new WeDevs\Wpuf\Admin\Forms\Field_Manager();
+ $this->container[ 'customize' ] = new WeDevs\Wpuf\Admin\Customizer_Options();
// Initialize legacy gateway classes for backward compatibility
- $this->container['bank'] = new WeDevs\Wpuf\Lib\Gateway\Bank();
- $this->container['paypal'] = new WeDevs\Wpuf\Lib\Gateway\Paypal();
+ $this->container[ 'bank' ] = new WeDevs\Wpuf\Lib\Gateway\Bank();
+ $this->container[ 'paypal' ] = new WeDevs\Wpuf\Lib\Gateway\Paypal();
// Initialize new gateway manager inside init hook for translation issue
add_action( 'init', [ $this, 'init_gateway_manager' ] );
- $this->container['api'] = new WeDevs\Wpuf\API();
- $this->container['integrations'] = new WeDevs\Wpuf\Integrations();
- $this->container['ai_manager'] = new WeDevs\Wpuf\AI_Manager();
+ $this->container[ 'api' ] = new WeDevs\Wpuf\API();
+ $this->container[ 'integrations' ] = new WeDevs\Wpuf\Integrations();
+ $this->container[ 'ai_manager' ] = new WeDevs\Wpuf\AI_Manager();
if ( is_admin() ) {
- $this->container['admin'] = new WeDevs\Wpuf\Admin();
- $this->container['setup_wizard'] = new WeDevs\Wpuf\Setup_Wizard();
- $this->container['pro_upgrades'] = new WeDevs\Wpuf\Pro_Upgrades();
- $this->container['privacy'] = new WeDevs\Wpuf\WPUF_Privacy();
+ $this->container[ 'admin' ] = new WeDevs\Wpuf\Admin();
+ $this->container[ 'setup_wizard' ] = new WeDevs\Wpuf\Setup_Wizard();
+ $this->container[ 'pro_upgrades' ] = new WeDevs\Wpuf\Pro_Upgrades();
+ $this->container[ 'privacy' ] = new WeDevs\Wpuf\WPUF_Privacy();
} else {
- $this->container['frontend'] = new WeDevs\Wpuf\Frontend();
+ $this->container[ 'frontend' ] = new WeDevs\Wpuf\Frontend();
}
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
@@ -214,7 +219,7 @@ public function instantiate() {
* @return void
*/
public function init_ajax() {
- $this->container['ajax'] = new WeDevs\Wpuf\Ajax();
+ $this->container[ 'ajax' ] = new WeDevs\Wpuf\Ajax();
}
/**
@@ -246,11 +251,11 @@ public function install() {
* @return void
*/
public function plugin_upgrades() {
- if ( ! is_admin() && ! current_user_can( 'manage_options' ) ) {
+ if ( !is_admin() && !current_user_can( 'manage_options' ) ) {
return;
}
- $this->container['upgrades'] = new WeDevs\Wpuf\Admin\Upgrades();
+ $this->container[ 'upgrades' ] = new WeDevs\Wpuf\Admin\Upgrades();
}
/**
@@ -299,11 +304,16 @@ public function wpuf_loader() {
if ( $has_pro ) {
$this->is_pro = true;
} else {
- $this->container['free_loader'] = new WeDevs\Wpuf\Free\Free_Loader();
+ $this->container[ 'free_loader' ] = new WeDevs\Wpuf\Free\Free_Loader();
+
+ $this->container[ 'free_loader' ]->includes();
+ $this->container[ 'free_loader' ]->instantiate();
+ $this->container[ 'free_loader' ]->run_hooks();
- $this->container['free_loader']->includes();
- $this->container['free_loader']->instantiate();
- $this->container['free_loader']->run_hooks();
+ // Load TEC venue/organizer fix when Pro is not active
+ if ( file_exists( WPUF_INCLUDES . '/Integrations/TEC_Venue_Organizer_Fix.php' ) ) {
+ require_once WPUF_INCLUDES . '/Integrations/TEC_Venue_Organizer_Fix.php';
+ }
}
// Remove the what's new option.
@@ -366,11 +376,11 @@ public function is_pro() {
*/
public function plugin_action_links( $links ) {
$links[] = '
' . esc_html( 'Settings' ) . '';
- $links[] = '
'. esc_html( 'Docs' ) . '';
+ $links[] = '
' . esc_html( 'Docs' ) . '';
- if ( ! $this->is_pro() ) {
- $links[] = '
'. esc_html( 'Upgrade to Pro' ) . '';
- $links[] = '
'. esc_html( 'Check Discounts' ) . '';
+ if ( !$this->is_pro() ) {
+ $links[] = '
' . esc_html( 'Upgrade to Pro' ) . '';
+ $links[] = '
' . esc_html( 'Check Discounts' ) . '';
}
return $links;
@@ -384,7 +394,7 @@ public function plugin_action_links( $links ) {
* @return void
*/
public function register_widgets() {
- $this->container['widgets'] = new WeDevs\Wpuf\Widgets\Manager();
+ $this->container[ 'widgets' ] = new WeDevs\Wpuf\Widgets\Manager();
}
public function license_expired() {
echo '
';