| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Page - Addons |
| 4 |
* |
| 5 |
* @var string $view |
| 6 |
* @var object $addons |
| 7 |
*/ |
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
add_ThickBox(); |
| 12 |
wp_enqueue_style( 'uwp-extensions-style', USERSWP_PLUGIN_URL . 'admin/assets/css/extensions.css',array(),'','' ); |
| 13 |
?> |
| 14 |
<div class="wrap uwp_addons_wrap"> |
| 15 |
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1> |
| 16 |
|
| 17 |
<?php if ( $tabs ){ ?> |
| 18 |
<nav class="nav-tab-wrapper uwp-nav-tab-wrapper"> |
| 19 |
<?php |
| 20 |
foreach ( $tabs as $name => $label ) { |
| 21 |
echo '<a href="' . esc_url( admin_url( 'admin.php?page=uwp-addons&tab=' . $name ) ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>'; |
| 22 |
} |
| 23 |
do_action( 'uwp_addons_tabs' ); |
| 24 |
?> |
| 25 |
</nav> |
| 26 |
<?php |
| 27 |
if($current_tab == 'membership'){ |
| 28 |
?> |
| 29 |
<div class="uwp-membership-tab-conatiner"> |
| 30 |
<h2>With our UsersWP Membership you get access to all our products!</h2> |
| 31 |
<p><a class="button button-primary" href="https://userswp.io/downloads/membership/">View Memberships</a></p> |
| 32 |
<?php if(defined('WP_EASY_UPDATES_ACTIVE')){?> |
| 33 |
<h2>Have a membership key?</h2> |
| 34 |
<p> |
| 35 |
<?php |
| 36 |
$wpeu_admin = new External_Updates_Admin('userswp.io','1'); |
| 37 |
echo $wpeu_admin->render_licence_actions('userswp.io', 'membership',array(238,239,240)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 38 |
?> |
| 39 |
</p> |
| 40 |
<?php }?> |
| 41 |
</div> |
| 42 |
|
| 43 |
<?php |
| 44 |
}else{ |
| 45 |
$installed_plugins = get_plugins(); |
| 46 |
$addon_obj = new UsersWP_Admin_Addons(); |
| 47 |
if ($addons = $addon_obj->get_section_data( $current_tab ) ) : |
| 48 |
?> |
| 49 |
<ul class="uwp-products"><?php foreach ( $addons as $addon ) : |
| 50 |
?><li class="uwp-product"> |
| 51 |
<div class="uwp-product-title"> |
| 52 |
<h3><?php |
| 53 |
if ( ! empty( $addon->info->excerpt) ){ |
| 54 |
echo uwp_help_tip( $addon->info->excerpt ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 55 |
} |
| 56 |
echo esc_html( $addon->info->title ); ?></h3> |
| 57 |
</div> |
| 58 |
|
| 59 |
<span class="uwp-product-image"> |
| 60 |
<?php if ( ! empty( $addon->info->thumbnail) ) : ?> |
| 61 |
<img src="<?php echo esc_attr( $addon->info->thumbnail ); ?>"/> |
| 62 |
<?php endif; |
| 63 |
|
| 64 |
if(isset($addon->info->link) && substr( $addon->info->link, 0, 21 ) === "https://wordpress.org"){ |
| 65 |
echo '<a href="' . esc_url( admin_url( '/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug.'&width=770&height=660&TB_iframe=true' ) ) . '" class="thickbox" >'; |
| 66 |
echo '<span class="uwp-product-info">' . esc_html__( 'More info','userswp' ) . '</span>'; |
| 67 |
echo '</a>'; |
| 68 |
}elseif(isset($addon->info->link) && substr( $addon->info->link, 0, 18 ) === "https://userswp.io"){ |
| 69 |
if(defined('WP_EASY_UPDATES_ACTIVE')){ |
| 70 |
$url = admin_url('/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug.'&width=770&height=660&item_id='.$addon->info->id.'&update_url=https://userswp.io&TB_iframe=true'); |
| 71 |
}else{ |
| 72 |
// if installed show activation link |
| 73 |
if(isset($installed_plugins['wp-easy-updates/external-updates.php'])){ |
| 74 |
$url = '#TB_inline?width=600&height=50&inlineId=uwp-wpeu-required-activation'; |
| 75 |
}else{ |
| 76 |
$url = '#TB_inline?width=600&height=50&inlineId=uwp-wpeu-required-for-external'; |
| 77 |
} |
| 78 |
} |
| 79 |
echo '<a href="' . esc_attr( $url ) . '" class="thickbox">'; |
| 80 |
echo '<span class="uwp-product-info">'.esc_html__('More info','userswp').'</span>'; |
| 81 |
echo '</a>'; |
| 82 |
} |
| 83 |
?> |
| 84 |
</span> |
| 85 |
<span class="uwp-product-button"><?php $addon_obj->output_button( $addon ); ?></span> |
| 86 |
<span class="uwp-price"><?php //print_r($addon); //echo wp_kses_post( $addon->price ); ?></span></li><?php endforeach; ?></ul> |
| 87 |
<?php endif; |
| 88 |
} |
| 89 |
} |
| 90 |
?> |
| 91 |
<div class="clearfix" ></div> |
| 92 |
<?php if($current_tab =='addons'){?> |
| 93 |
<p><?php printf( __( 'All of our UsersWP Addons can be found on UsersWP.io here: <a href="%s">UsersWP Addons</a>', 'userswp' ), 'https://userswp.io/downloads/category/addons/' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 94 |
<?php } ?> |
| 95 |
|
| 96 |
<div id="uwp-wpeu-required-activation" style="display:none;"><span class="uwp-notification "><?php printf( __("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.",'userswp'),wp_nonce_url( esc_url( admin_url('plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php') ), 'activate-plugin_wp-easy-updates/external-updates.php')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span></div> |
| 97 |
<div id="uwp-wpeu-required-for-external" style="display:none;"><span class="uwp-notification "><?php printf( __("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s' onclick='window.open(\"https://wpeasyupdates.com/wp-easy-updates.zip\", \"_blank\");' >download</a> and install it now.",'userswp'), esc_url( admin_url("plugin-install.php?tab=upload&wpeu-install=true") ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span></div> |
| 98 |
<div id="wpeu-licence-popup" style="display:none;"> |
| 99 |
<span class="uwp-notification noti-white"> |
| 100 |
<h3 class="wpeu-licence-title"><?php esc_html_e("Licence key",'userswp');?></h3> |
| 101 |
<input class="wpeu-licence-key" type="text" placeholder="<?php esc_attr_e("Enter your licence key",'userswp');?>"> <button class="button-primary wpeu-licence-popup-button" ><?php esc_html_e("Install",'userswp');?></button> |
| 102 |
<br> |
| 103 |
<?php |
| 104 |
echo wp_sprintf( __('%sFind your licence key here%s OR %sBuy one here%s', 'userswp'), '<a href="https://userswp.io/your-account/" target="_blank">','</a>','<a class="wpeu-licence-link" href="https://userswp.io/downloads/category/addons/" target="_blank">','</a>' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 105 |
?> |
| 106 |
</span> |
| 107 |
</div> |
| 108 |
|
| 109 |
</div> |
| 110 |
|