PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Settings/CustomOptions/TPTIntegrationOption.php +42 -11 6.1.0 → 8.0.2 View file →
@@ -17,8 +17,10 @@
17 17 }, 10, 3 );
18 18 }
19 19
20 20 public function render( $value ) {
21 + // the description is plugin-defined text (settings arrays), read once for output
22 + $description = (string) ( $value['desc'] ?? '' );
21 23 if ( ! isset( $value['id'] ) ) {
22 24 $value['id'] = '';
23 25 }
24 26
@@ -44,34 +46,62 @@
44 46 $value['desc'] = '';
45 47 }
46 48
47 49 $option_value = $value['value'];
48 -
50 + $is_official = ! empty( $value['official'] );
51 + $action_links = isset( $value['action_links'] ) && is_array( $value['action_links'] ) ? $value['action_links'] : array();
52 + $meta_pills = isset( $value['meta_pills'] ) && is_array( $value['meta_pills'] ) ? $value['meta_pills'] : array();
49 53 ?>
50 -
51 - <tr class="tpt-integration-item" style="display: flex; width: 50%; min-width: 400px;">
54 + <tr class="tpt-integration-item <?php echo $is_official ? 'tpt-integration-item--official' : ''; ?>">
52 55 <td>
53 - <div style="display: flex; gap: 20px;">
54 - <div class="tpt-integration-item__image" style="width:100px;">
55 - <img src="<?php echo esc_attr( $value['icon_url'] ); ?>" width="100px" height="100px"
56 - alt="<?php echo esc_html( $value['title'] ); ?>">
56 + <div class="tpt-integration-wrapper <?php echo $is_official ? 'tpt-integration-wrapper--official' : ''; ?>">
57 + <div class="tpt-integration-item__image">
58 + <img src="<?php echo esc_attr( $value['icon_url'] ); ?>"
59 + alt="<?php echo esc_attr( $value['title'] ); ?>">
57 60 </div>
58 61 <div class="tpt-integration-item__description">
62 + <div class="tpt-integration-item__content">
59 63
64 + <?php $official_badge = $is_official ? ' <span class="tpt-integration-item__official-badge">' . esc_html__( 'By U2Code', 'tier-pricing-table' ) . '</span>' : ''; ?>
60 65 <?php if ( $value['author_url'] ) : ?>
61 66 <a target="_blank" href="<?php echo esc_attr( $value['author_url'] ); ?>">
62 - <h4 style="margin-top: 0; margin-bottom: 10px"><?php echo esc_html( $value['title'] ); ?></h4>
67 + <h4><?php echo esc_html( $value['title'] ) . wp_kses_post( $official_badge ); ?></h4>
63 68 </a>
64 69 <?php else : ?>
65 - <h4 style="margin-top: 0; margin-bottom: 10px"><?php echo esc_html( $value['title'] ); ?></h4>
70 + <h4><?php echo esc_html( $value['title'] ) . wp_kses_post( $official_badge ); ?></h4>
66 71 <?php endif; ?>
67 72
73 + <?php if ( $meta_pills ) : ?>
74 + <div class="tpt-integration-item__pills">
75 + <?php foreach ( $meta_pills as $pill ) : ?>
76 + <span class="tpt-integration-item__pill"><?php echo esc_html( $pill ); ?></span>
77 + <?php endforeach; ?>
78 + </div>
79 + <?php endif; ?>
80 +
68 81 <p class="description">
69 82 <?php
70 - echo wp_kses_post( $value['desc'] ); // audit.php.wp.security.xss.shortcode-attr ignore
83 + echo wp_kses_post( $description ); // nosemgrep
71 84 ?>
72 85 </p>
73 - <div class="tpt-integration-item-checkbox" style="margin-top: 10px">
86 +
87 + </div>
88 +
89 + <div class="tpt-integration-item__actions">
90 + <?php if ( $action_links ) : ?>
91 + <div class="tpt-integration-item__action-links">
92 + <?php foreach ( $action_links as $action_link ) : ?>
93 + <?php if ( empty( $action_link['url'] ) || empty( $action_link['label'] ) ) { continue; } ?>
94 + <a class="tpt-integration-item__action-link"
95 + target="<?php echo esc_attr( $action_link['target'] ?? '_blank' ); ?>"
96 + <?php echo ( $action_link['target'] ?? '_blank' ) === '_blank' ? 'rel="noopener"' : ''; ?>
97 + href="<?php echo esc_url( $action_link['url'] ); ?>">
98 + <?php echo esc_html( $action_link['label'] ); ?> &rarr;
99 + </a>
100 + <?php endforeach; ?>
101 + </div>
102 + <?php endif; ?>
103 + <div class="tpt-integration-item-checkbox">
74 104 <input
75 105 name="<?php echo esc_attr( $value['id'] ); ?>"
76 106 id="<?php echo esc_attr( $value['id'] ); ?>"
77 107 type="checkbox"
@@ -82,8 +112,9 @@
82 112 <label for="<?php echo esc_attr( $value['id'] ); ?>">
83 113 <span data-tpt-toggle-switch-on><?php echo esc_attr( $value['on_label'] ); ?></span>
84 114 <span data-tpt-toggle-switch-off><?php echo esc_attr( $value['off_label'] ); ?></span>
85 115 </label>
116 + </div>
86 117 </div>
87 118 </div>
88 119 </div>
89 120 </td>