Skip to content

Commit

Permalink
Merge branch 'release/4.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth committed Oct 14, 2024
2 parents d5c0b7c + 1b12d97 commit b477a17
Show file tree
Hide file tree
Showing 34 changed files with 1,926 additions and 854 deletions.
14 changes: 4 additions & 10 deletions Lib/Appsero/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WeDevs\Wpuf\Lib\Appsero;

use WP_Error;

/**
* Appsero Client
*
Expand Down Expand Up @@ -110,13 +112,9 @@ public function __construct( $hash, $name, $file ) {
/**
* Initialize insights class
*
* @return Appsero\Insights
* @return object
*/
public function insights() {
if ( ! class_exists( __NAMESPACE__ . '\Insights' ) ) {
require_once __DIR__ . '/Insights.php';
}

// if already instantiated, return the cached one
if ( $this->insights ) {
return $this->insights;
Expand All @@ -130,13 +128,9 @@ public function insights() {
/**
* Initialize license checker
*
* @return Appsero\License
* @return object
*/
public function license() {
if ( ! class_exists( __NAMESPACE__ . '\License' ) ) {
require_once __DIR__ . '/License.php';
}

// if already instantiated, return the cached one
if ( $this->license ) {
return $this->license;
Expand Down
12 changes: 2 additions & 10 deletions Lib/WeDevs_Insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace WeDevs\Wpuf\Lib;

if ( ! class_exists( 'WPUF_WeDevs_Insights' ) ) :
if ( ! class_exists( 'WeDevs_Insights' ) ) :

/**
* weDevs Tracker
Expand All @@ -17,26 +17,18 @@
*/
class WeDevs_Insights {
/**
* @var object|Appsero\Insights|Insights
* @var object|Appsero\Insights
*/
public $insights;

/**
* Initialize the class
*/
public function __construct( $file ) {
if ( ! class_exists( 'Appsero\Client' ) ) {
require_once WPUF_ROOT . '/Lib/Appsero/Client.php';
}

$client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );
$this->insights = $client->insights();
$this->insights->client = $client;
$this->insights->init();

// $client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );
// $this->insights = $client->insights();
// $this->insights->init();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Lib/WeDevs_Settings_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function get_option( $option, $section, $default = '' ) {
function show_navigation() {
$html = '<h2 class="nav-tab-wrapper">';
$html .= '<div id="wpuf-search-section">
<input type="text" id="wpuf-settings-search" placeholder="Search in settings">
<input type="text" id="wpuf-settings-search" placeholder="'. esc_attr__( 'Search in settings', 'wp-user-frontend' ) .'">
<span class="dashicons dashicons-no-alt"></span>
</div>';
$count = count( $this->settings_sections );
Expand Down
2 changes: 2 additions & 0 deletions admin/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/**
* WPUF settings
*/

#[AllowDynamicProperties]
class WPUF_Admin_Settings {

/**
Expand Down
5 changes: 3 additions & 2 deletions admin/html/form-settings-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@
'taxonomy' => $tax->name,
];

$tax = '<tr class="wpuf_settings_taxonomy"> <th> Default '. $post_type_selected . ' '. $tax->name .'</th> <td>
<select multiple name="wpuf_settings[default_'.$tax->name.'][]">';
// translators: %s: post type name and taxonomy name
$tax = '<tr class="wpuf_settings_taxonomy"> <th>' . sprintf( __( 'Default %s %s', 'wp-user-frontend' ), $post_type_selected, $tax->name ) . '</th> <td>
<select multiple name="wpuf_settings[default_'.$tax->name.'][]">';
$categories = get_terms( $args );

foreach ( $categories as $category ) {
Expand Down
9 changes: 1 addition & 8 deletions assets/css/frontend-forms.css
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,6 @@ body ul.wpuf-form li .wpuf-address-field:after {
display: table;
}
body ul.wpuf-form li .wpuf-address-field.city_name,
body ul.wpuf-form li .wpuf-address-field.state,
body ul.wpuf-form li .wpuf-address-field.zip,
body ul.wpuf-form li .wpuf-address-field.country_select {
float: left;
width: 47%;
}
body ul.wpuf-form li .wpuf-address-field.city_name,
body ul.wpuf-form li .wpuf-address-field.zip {
margin-right: 4%;
}
Expand Down Expand Up @@ -1835,7 +1828,7 @@ body .wpuf-attachment-upload-filelist + .moxie-shim {
}
img.wpuf-eye {
position: absolute;
right: 0;
right: 1rem;
top: 50%;
transform: translateY(-50%) translateX(-6%);
}
2 changes: 1 addition & 1 deletion assets/js/components/subscriptions/SectionInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const processInput = (event) => {
};
const processNumber = (event) => {
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight'];
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight', '.'];
if (!allowedKeys.includes(event.key) && isNaN(Number(event.key))) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/subscriptions.min.js

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions assets/less/frontend-forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -603,14 +603,6 @@ ul.wpuf-form {
width: 100%;
margin-bottom: 10px;

&.city_name,
&.state,
&.zip,
&.country_select {
float: left;
width: 47%;
}

&.city_name,
&.zip {
margin-right: 4%;
Expand Down Expand Up @@ -2124,7 +2116,7 @@ ul.wpuf-form{

img.wpuf-eye {
position: absolute;
right: 0;
right: 1rem;
top: 50%;
transform: translateY(-50%) translateX(-6%);
}
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
= v4.0.12 (14 Oct, 2024) =
* Enhance - Decimal value for subscription pack
* Fix - Required asterisk on password label
* Fix - Field overlapping in address field
* Fix - Read-only does not work for 'Teeny Rich textarea'
* Fix - Integrations not loading properly for Dokan, ACF, WC Vendors

= v4.0.11 (12 Sep, 2024) =
* Enhance - Subscription design revamp
* Enhance - Consistent format in email templates
Expand Down
16 changes: 15 additions & 1 deletion includes/Admin/Admin_Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,21 @@ public function subs_meta_box() {
<th><?php esc_html_e( 'Expiration Message', 'wp-user-frontend' ); ?></th>
<td>
<textarea name="post_expiration_settings[post_expiration_message]" id="wpuf-post_expiration_message" cols="50" rows="5"><?php echo esc_attr( $post_expiration_message ); ?></textarea>
<p class="description"><strong><?php echo esc_html( __( 'You may use: {post_author} {post_url} {blogname} {post_title} {post_status}', 'wp-user-frontend' ) ); ?></strong></p>
<p class="description">
<strong>
<?php
printf(
// translators: %1$s: {post_author}, %2$s: {post_url}, %3$s: {blogname}, %4$s: {post_title}, %5$s: {post_status}
__( 'You may use: %1$s %2$s %3$s %4$s %5$s', 'wp-user-frontend' ),
'{post_author}',
'{post_url}',
'{blogname}',
'{post_title}',
'{post_status}'
)
?>
</strong>
</p>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions includes/Admin/Forms/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Form {
/**
* @var array|\WP_Post|null
*/
private $data;
public $data;

public function __construct( $form ) {
if ( is_numeric( $form ) ) {
Expand Down Expand Up @@ -182,7 +182,9 @@ public function is_submission_open( $form, $form_settings ) {
return [ $user_can_post, $info ];
}

$has_post_count = $current_user->subscription()->has_post_count( $form_settings['post_type'] );
$post_type = ! empty( $form_settings['post_type'] ) ? $form_settings['post_type'] : 'post';

$has_post_count = $current_user->subscription()->has_post_count( $post_type );

if ( $current_user->subscription()->current_pack_id() && ! $has_post_count ) {
$user_can_post = 'no';
Expand Down
Loading

0 comments on commit b477a17

Please sign in to comment.