meta-box.php
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Integrations meta box
*
* @package WP_Smush
*
* @var array $basic_features Basic features array.
* @var bool $is_pro Is PRO user or not.
* @var array $integration_group Integration group.
* @var array $settings Settings array.
*
* @var Abstract_Page $this
*/
use Smush\App\Abstract_Page;
use Smush\Core\Helper;
if ( ! defined( 'WPINC' ) ) {
die;
}
foreach ( $integration_group as $name ) {
$is_integration_disabled = apply_filters( 'wp_smush_integration_status_' . $name, false ); // Disable setting.
$is_pro_field = $this->settings->is_pro_field( $name ); // Gray out row, disable setting.
$is_disabled_field = $is_integration_disabled || ( $is_pro_field && ! $is_pro );
$value = $is_disabled_field || empty( $settings[ $name ] ) ? false : $settings[ $name ];
do_action( 'wp_smush_render_setting_row', $name, $value, $is_disabled_field );
}
?>
<?php if ( ! $is_pro ) : ?>
<div class="sui-upsell-notice sui-padding sui-padding-bottom__desktop--hidden">
<div class="sui-upsell-notice__image" aria-hidden="true">
<img
class="sui-image"
src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-graphic-integrations-upsell.png' ); ?>"
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-graphic-integrations-upsell@2x.png' ); ?> 2x"
alt="<?php esc_attr_e( 'Upgrade to Pro', 'wp-smushit' ); ?>"
/>
</div>
<div class="sui-upsell-notice__content">
<div class="sui-notice sui-notice-purple">
<div class="sui-notice-content">
<div class="sui-notice-message">
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
<p>
<?php
printf( /* translators: %1$s - a href tag, %2$s - a href closing tag */
esc_html__( 'Smush Pro supports hosting images on Amazon S3 and optimizing NextGen Gallery images directly through NextGen Gallery settings. %1$sTry it free%2$s with a WPMU DEV membership today!', 'wp-smushit' ),
'<a href="' . esc_url( Helper::get_url( 'smush-nextgen-settings-upsell' ) ) . '" target="_blank" title="' . esc_html__( 'Try Smush Pro for FREE', 'wp-smushit' ) . '">',
'</a>'
);
?>
</p>
<p>
<a href="<?php echo esc_url( Helper::get_url( 'smush-nextgen-settings-upsell' ) ); ?>" target="_blank" class="sui-button sui-button-purple">
<?php esc_html_e( 'Try Smush Pro for Free', 'wp-smushit' ); ?>
</a>
</p>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>