Skip to content

Commit 0409e4e

Browse files
release: fixes
- Fixed broken product page layout with Collapse field in use - Fixed issue with files can't be downloaded from the Order Received email - Updated dependencies
2 parents ec80397 + c7bf1d0 commit 0409e4e

File tree

9 files changed

+75
-26
lines changed

9 files changed

+75
-26
lines changed

backend/settings-panel.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function __construct() {
9898

9999
add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ), 999 );
100100

101-
add_action( 'in_admin_header', array( $this, 'remove_admin_notices' ), 99 );
101+
// add_action( 'in_admin_header', array( $this, 'remove_admin_notices' ), 99 );
102102
// delete_option('ppom_settings_migration_done');
103103
}
104104

classes/form.class.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ function( $collapse_field ) {
182182

183183
$section_started = true;
184184
$ppom_collapse_counter ++;
185+
186+
if ( count( $fields ) === $ppom_field_counter ) {
187+
echo '</div>';
188+
}
185189
}
186190

187191
// skip collapse div
@@ -218,14 +222,14 @@ function( $collapse_field ) {
218222

219223
$field_html .= '</div>';
220224

221-
if ( count( $collapse_fields ) === $ppom_collapse_counter && $section_started ) {
222-
$section_started = false;
223-
}
224-
225225
// Filter: nmforms_input_htmls
226226
// @TODO need to change with relevant name
227227
echo apply_filters( 'nmforms_input_html', $field_html, $meta, $default_value );
228228

229+
if ( count( $fields ) === $ppom_field_counter && $section_started ) {
230+
echo '</div>';
231+
$section_started = false;
232+
}
229233
}
230234
}
231235

classes/plugin.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function __construct() {
322322
// NOTE: Debug only
323323
// delete_option('ppom_demo_meta_installed');
324324

325-
add_action( 'in_admin_header', 'ppom_hooks_remove_admin_notices', 99 );
325+
// add_action( 'in_admin_header', 'ppom_hooks_remove_admin_notices', 99 );
326326

327327
add_filter( 'woocommerce_order_again_cart_item_data', 'ppom_wc_order_again_compatibility', 10, 3 );
328328
// Show description tooltip.

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/ppom-admin.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,14 @@ header.ppom-modal-header {
18631863
text-decoration: none;
18641864
}
18651865

1866-
.ppom-banner:has(.tsdk-banner-cta) {
1867-
margin: 20px 0;
1866+
div.ppom-banner .themeisle-sale {
1867+
margin: 0 0 10px 0;
18681868
}
1869+
1870+
.ppom-banner .themeisle-sale-title {
1871+
font-size: 14px;
1872+
}
1873+
1874+
.ppom-banner .themeisle-sale .themeisle-sale-action a {
1875+
text-decoration: none;
1876+
}

images/black-friday.jpg

-90.1 KB
Binary file not shown.

inc/admin.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,47 @@ function ppom_admin_bar_menu() {
821821
);
822822
}
823823
}
824+
825+
/**
826+
* Set Black Friday data.
827+
*
828+
* @param array $configs The configuration array for the loaded products.
829+
*
830+
* @return array
831+
*/
832+
function ppom_add_black_friday_data( $configs ) {
833+
$config = $configs['default'];
834+
835+
// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
836+
$message_template = __( 'Our biggest sale of the year: %1$sup to %2$s OFF%3$s on %4$s. Don\'t miss this limited-time offer.', 'woocommerce-product-addon' );
837+
$product_label = 'PPOM';
838+
$discount = '70%';
839+
840+
$plan = apply_filters( 'product_ppom_license_plan', 0 );
841+
$license = apply_filters( 'product_ppom_license_key', false );
842+
$is_pro = 0 < $plan;
843+
844+
if ( $is_pro ) {
845+
// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
846+
$message_template = __( 'Get %1$sup to %2$s off%3$s when you upgrade your %4$s plan or renew early.', 'woocommerce-product-addon' );
847+
$product_label = 'PPOM Pro';
848+
$discount = '30%';
849+
}
850+
851+
$product_label = sprintf( '<strong>%s</strong>', $product_label );
852+
$url_params = array(
853+
'utm_term' => $is_pro ? 'plan-' . $plan : 'free',
854+
'lkey' => ! empty( $license ) ? $license : false,
855+
);
856+
857+
$config['message'] = sprintf( $message_template, '<strong>', $discount, '</strong>', $product_label );
858+
$config['sale_url'] = add_query_arg(
859+
$url_params,
860+
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/ppom-bf', 'bfcm', 'ppom' ) )
861+
);
862+
863+
$configs[ PPOM_PRODUCT_SLUG ] = $config;
864+
865+
return $configs;
866+
}
867+
add_filter( 'themeisle_sdk_blackfriday_data', 'ppom_add_black_friday_data' );

inc/files.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ function ppom_create_thumb_for_meta( $file_name, $product_id, $cropped = false,
142142
* @return string The new file name.
143143
*/
144144
function ppom_create_unique_file_name( $file_name, $file_ext ) {
145-
return $file_name . "." . base64_encode( substr( wp_hash_password( $file_name ), 0, 8 ) ) . "." . $file_ext;
145+
$seed = $file_name . microtime( true ) . mt_rand();
146+
return $file_name . "." . wp_hash( $seed ) . "." . $file_ext;
146147
}
147148

148149
final class UploadFileErrors {

inc/functions.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,17 +1595,9 @@ function ppom_generate_html_for_files( $file_names, $input_type, $item ) {
15951595
$is_image_file = ppom_is_file_image( $file_path );
15961596
$ppom_file_thumb_url = $is_image_file ? $file_path : PPOM_URL . '/images/file.png';
15971597
$order_html .= '<tr><td class="ppom-files-display">';
1598-
1599-
if ( $is_image_file ) {
1600-
$order_html .= '<a target="_blank" href="' . esc_url( $ppom_file_url ) . '">';
1601-
}
1602-
1603-
$order_html .= '<img class="img-thumbnail" style="width:' . esc_attr( ppom_get_thumbs_size() ) . '" src="' . esc_url( $ppom_file_thumb_url ) . '">';
1604-
1605-
if ( $is_image_file ) {
1606-
$order_html .= '</a>';
1607-
}
1608-
1598+
$order_html .= '<a target="_blank" href="' . esc_url( $ppom_file_url ) . '">';
1599+
$order_html .= '<img class="img-thumbnail" style="width:' . esc_attr( ppom_get_thumbs_size() ) . '" src="' . esc_url( $ppom_file_thumb_url ) . '">';
1600+
$order_html .= '</a>';
16091601

16101602
// Requested by Kevin, hiding downloading file button after order on thank you page
16111603
// @since version 16.6

0 commit comments

Comments
 (0)