} ?> <p> <?php if (!empty($VARS['title'])) { ?> <b><?php echo $VARS['title']; ?> </b> <?php } ?> <?php echo $VARS['message']; ?> </p><?php if ($VARS['sticky']) { ?> <div class="fs-close"><i class="dashicons dashicons-no" title="<?php _efs('dismiss'); ?> "></i> <span><?php _efs('dismiss'); ?> </span> </div><?php } ?> </div>
/** * Display plugin information in dialog box form. * * Based on core install_plugin_information() function. * * @author Vova Feldman (@svovaf) * @since 1.0.6 */ function install_plugin_information() { global $tab; if (empty($_REQUEST['plugin'])) { return; } $args = array('slug' => wp_unslash($_REQUEST['plugin']), 'is_ssl' => is_ssl(), 'fields' => array('banners' => true, 'reviews' => true, 'downloaded' => false, 'active_installs' => true)); if (is_array($args)) { $args = (object) $args; } if (!isset($args->per_page)) { $args->per_page = 24; } if (!isset($args->locale)) { $args->locale = get_locale(); } $api = apply_filters('fs_plugins_api', false, 'plugin_information', $args); if (is_wp_error($api)) { wp_die($api); } $plugins_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array(), 'class' => array()), 'style' => array(), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'div' => array('class' => array()), 'span' => array('class' => array()), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array('class' => array()), 'i' => array('class' => array()), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), 'img' => array('src' => array(), 'class' => array(), 'alt' => array())); $plugins_section_titles = array('description' => _x('Description', 'Plugin installer section title'), 'installation' => _x('Installation', 'Plugin installer section title'), 'faq' => _x('FAQ', 'Plugin installer section title'), 'screenshots' => _x('Screenshots', 'Plugin installer section title'), 'changelog' => _x('Changelog', 'Plugin installer section title'), 'reviews' => _x('Reviews', 'Plugin installer section title'), 'other_notes' => _x('Other Notes', 'Plugin installer section title')); // Sanitize HTML // foreach ( (array) $api->sections as $section_name => $content ) { // $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags ); // } foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) { if (isset($api->{$key})) { $api->{$key} = wp_kses($api->{$key}, $plugins_allowedtags); } } // Add after $api->slug is ready. $plugins_section_titles['features'] = __fs('features-and-pricing', $api->slug); $_tab = esc_attr($tab); $section = isset($_REQUEST['section']) ? wp_unslash($_REQUEST['section']) : 'description'; // Default to the Description tab, Do not translate, API returns English. if (empty($section) || !isset($api->sections[$section])) { $section_titles = array_keys((array) $api->sections); $section = array_shift($section_titles); } iframe_header(__('Plugin Install')); $_with_banner = ''; // var_dump($api->banners); if (!empty($api->banners) && (!empty($api->banners['low']) || !empty($api->banners['high']))) { $_with_banner = 'with-banner'; $low = empty($api->banners['low']) ? $api->banners['high'] : $api->banners['low']; $high = empty($api->banners['high']) ? $api->banners['low'] : $api->banners['high']; ?> <style type="text/css"> #plugin-information-title.with-banner { background-image: url( <?php echo esc_url($low); ?> ); } @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 ) { #plugin-information-title.with-banner { background-image: url( <?php echo esc_url($high); ?> ); } } </style> <?php } echo '<div id="plugin-information-scrollable">'; echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>"; echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n"; foreach ((array) $api->sections as $section_name => $content) { if ('reviews' === $section_name && (empty($api->ratings) || 0 === array_sum((array) $api->ratings))) { continue; } if (isset($plugins_section_titles[$section_name])) { $title = $plugins_section_titles[$section_name]; } else { $title = ucwords(str_replace('_', ' ', $section_name)); } $class = $section_name === $section ? ' class="current"' : ''; $href = add_query_arg(array('tab' => $tab, 'section' => $section_name)); $href = esc_url($href); $san_section = esc_attr($section_name); echo "\t<a name='{$san_section}' href='{$href}' {$class}>{$title}</a>\n"; } echo "</div>\n"; ?> <div id="<?php echo $_tab; ?> -content" class='<?php echo $_with_banner; ?> '> <div class="fyi"> <?php if ($api->is_paid) { ?> <?php if (isset($api->plans)) { ?> <div class="plugin-information-pricing"> <?php foreach ($api->plans as $plan) { ?> <?php /** * @var FS_Plugin_Plan $plan */ ?> <?php $first_pricing = $plan->pricing[0]; ?> <?php $is_multi_cycle = $first_pricing->is_multi_cycle(); ?> <div class="fs-plan<?php if (!$is_multi_cycle) { echo ' fs-single-cycle'; } ?> " data-plan-id="<?php echo $plan->id; ?> "> <h3 data-plan="<?php echo $plan->id; ?> "><?php printf(__fs('x-plan', $api->slug), $plan->title); ?> </h3> <?php $has_annual = $first_pricing->has_annual(); ?> <?php $has_monthly = $first_pricing->has_monthly(); ?> <div class="nav-tab-wrapper"> <?php $billing_cycles = array('monthly', 'annual', 'lifetime'); ?> <?php $i = 0; foreach ($billing_cycles as $cycle) { ?> <?php $prop = "{$cycle}_price"; if (isset($first_pricing->{$prop})) { ?> <?php $is_featured = 'annual' === $cycle && $is_multi_cycle; ?> <?php $prices = array(); foreach ($plan->pricing as $pricing) { if (isset($pricing->{$prop})) { $prices[] = array('id' => $pricing->id, 'licenses' => $pricing->licenses, 'price' => $pricing->{$prop}); } } ?> <a class="nav-tab" data-billing-cycle="<?php echo $cycle; ?> " data-pricing="<?php esc_attr_e(json_encode($prices)); ?> "> <?php if ($is_featured) { ?> <label>★ <?php _efs('best', $api->slug); ?> ★</label> <?php } ?> <?php _efs($cycle, $api->slug); ?> </a> <?php } ?> <?php $i++; } ?> <?php wp_enqueue_script('jquery'); ?> <script type="text/javascript"> (function ($, undef) { var _formatBillingFrequency = function (cycle) { switch (cycle) { case 'monthly': return '<?php printf(__fs('billed-x', $api->slug), __fs('monthly', $api->slug)); ?> '; case 'annual': return '<?php printf(__fs('billed-x', $api->slug), __fs('annually', $api->slug)); ?> '; case 'lifetime': return '<?php printf(__fs('billed-x', $api->slug), __fs('once', $api->slug)); ?> '; } }, _formatLicensesTitle = function (pricing) { switch (pricing.licenses) { case 1: return '<?php _efs('license-single-site', $api->slug); ?> '; case null: return '<?php _efs('license-unlimited', $api->slug); ?> '; default: return '<?php _efs('license-x-sites', $api->slug); ?> '.replace('%s', pricing.licenses); } }, _formatPrice = function (pricing, cycle, multipleLicenses) { if (undef === multipleLicenses) multipleLicenses = true; var priceCycle; switch (cycle) { case 'monthly': priceCycle = ' / <?php _efs('mo', $api->slug); ?> '; break; case 'lifetime': priceCycle = ''; break; case 'annual': default: priceCycle = ' / <?php _efs('year', $api->slug); ?> '; break; } if (!multipleLicenses && 1 == pricing.licenses) { return '$' + pricing.price + priceCycle; } return _formatLicensesTitle(pricing) + ' - <var class="fs-price">$' + pricing.price + priceCycle + '</var>'; }, _checkoutUrl = function (plan, pricing, cycle) { return '<?php echo esc_url_raw(remove_query_arg('billing_cycle', add_query_arg(array('plugin_id' => $plan->plugin_id), $api->checkout_link))); ?> ' + '&plan_id=' + plan + '&pricing_id=' + pricing + '&billing_cycle=' + cycle<?php if ($plan->has_trial()) { echo " + '&trial=true'"; } ?> ; }, _updateCtaUrl = function (plan, pricing, cycle) { $('.plugin-information-pricing .button, #plugin-information-footer .button').attr('href', _checkoutUrl(plan, pricing, cycle)); }; $(document).ready(function () { var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id; ?> ]'); $plan.find('input[type=radio]').live('click', function () { _updateCtaUrl( $plan.attr('data-plan-id'), $(this).val(), $plan.find('.nav-tab-active').attr('data-billing-cycle') ); $plan.find('.fs-trial-terms .fs-price').html( $(this).parents('label').find('.fs-price').html() ); }); $plan.find('.nav-tab').click(function () { if ($(this).hasClass('nav-tab-active')) return; var $this = $(this), billingCycle = $this.attr('data-billing-cycle'), pricing = JSON.parse($this.attr('data-pricing')), $pricesList = $this.parents('.fs-plan').find('.fs-pricing-body .fs-licenses'), html = ''; // Un-select previously selected tab. $plan.find('.nav-tab').removeClass('nav-tab-active'); // Select current tab. $this.addClass('nav-tab-active'); // Render licenses prices. if (1 == pricing.length) { html = '<li><label><?php _efs('price', $api->slug); ?> : ' + _formatPrice(pricing[0], billingCycle, false) + '</label></li>'; } else { for (var i = 0; i < pricing.length; i++) { html += '<li><label><input name="pricing-<?php echo $plan->id; ?> " type="radio" value="' + pricing[i].id + '">' + _formatPrice(pricing[i], billingCycle) + '</label></li>'; } } $pricesList.html(html); if (1 < pricing.length) { // Select first license option. $pricesList.find('li:first input').click(); } else { _updateCtaUrl( $plan.attr('data-plan-id'), pricing[0].id, billingCycle ); } // Update billing frequency. $plan.find('.fs-billing-frequency').html(_formatBillingFrequency(billingCycle)); if ('annual' === billingCycle) { $plan.find('.fs-annual-discount').show(); } else { $plan.find('.fs-annual-discount').hide(); } }); <?php if ($has_annual) { ?> // Select annual by default. $plan.find('.nav-tab[data-billing-cycle=annual]').click(); <?php } else { ?> // Select first tab. $plan.find('.nav-tab:first').click(); <?php } ?> }); }(jQuery)); </script> </div> <div class="fs-pricing-body"> <span class="fs-billing-frequency"></span> <?php $annual_discount = $has_annual && $has_monthly ? $plan->pricing[0]->annual_discount_percentage() : 0; ?> <?php if ($annual_discount > 0) { ?> <span class="fs-annual-discount"><?php printf(__fs('save-x', $api->slug), $annual_discount . '%'); ?> </span> <?php } ?> <ul class="fs-licenses"> </ul> <?php echo $this->get_plugin_cta($api, $plan); ?> <div style="clear:both"></div> <?php if ($plan->has_trial()) { ?> <?php $trial_period = $this->get_trial_period($plan); ?> <ul class="fs-trial-terms"> <li> <i class="dashicons dashicons-yes"></i><?php printf(__fs('no-commitment-x', $api->slug), $trial_period); ?> </li> <li> <i class="dashicons dashicons-yes"></i><?php printf(__fs('after-x-pay-as-little-y', $api->slug), $trial_period, '<var class="fs-price">' . $this->get_price_tag($plan, $plan->pricing[0]) . '</var>'); ?> </li> </ul> <?php } ?> </div> </div> </div> <?php } ?> <?php } ?> <?php } ?> <div> <h3><?php _efs('details', $api->slug); ?> </h3> <ul> <?php if (!empty($api->version)) { ?> <li><strong><?php _e('Version:'); ?> </strong> <?php echo $api->version; ?> </li> <?php } if (!empty($api->author)) { ?> <li> <strong><?php _e('Author:'); ?> </strong> <?php echo links_add_target($api->author, '_blank'); ?> </li> <?php } if (!empty($api->last_updated)) { ?> <li><strong><?php _e('Last Updated:'); ?> </strong> <span title="<?php echo $api->last_updated; ?> "> <?php printf(__('%s ago'), human_time_diff(strtotime($api->last_updated))); ?> </span></li> <?php } if (!empty($api->requires)) { ?> <li> <strong><?php _e('Requires WordPress Version:'); ?> </strong> <?php printf(__('%s or higher'), $api->requires); ?> </li> <?php } if (!empty($api->tested)) { ?> <li><strong><?php _e('Compatible up to:'); ?> </strong> <?php echo $api->tested; ?> </li> <?php } if (!empty($api->downloaded)) { ?> <li> <strong><?php _e('Downloaded:'); ?> </strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)); ?> </li> <?php } if (!empty($api->slug) && empty($api->external)) { ?> <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?> /"><?php _e('WordPress.org Plugin Page »'); ?> </a> </li> <?php } if (!empty($api->homepage)) { ?> <li><a target="_blank" href="<?php echo esc_url($api->homepage); ?> "><?php _e('Plugin Homepage »'); ?> </a> </li> <?php } if (!empty($api->donate_link) && empty($api->contributors)) { ?> <li><a target="_blank" href="<?php echo esc_url($api->donate_link); ?> "><?php _e('Donate to this plugin »'); ?> </a> </li> <?php } ?> </ul> </div> <?php if (!empty($api->rating)) { ?> <h3><?php _e('Average Rating'); ?> </h3> <?php wp_star_rating(array('rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings)); ?> <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?> </small> <?php } if (!empty($api->ratings) && array_sum((array) $api->ratings) > 0) { foreach ($api->ratings as $key => $ratecount) { // Avoid div-by-zero. $_rating = $api->num_ratings ? $ratecount / $api->num_ratings : 0; ?> <div class="counter-container"> <span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?> ?filter=<?php echo $key; ?> " target="_blank" title="<?php echo esc_attr(sprintf(_n('Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key), $key)); ?> "><?php printf(_n('%d star', '%d stars', $key), $key); ?> </a></span> <span class="counter-back"> <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?> px;"></span> </span> <span class="counter-count"><?php echo number_format_i18n($ratecount); ?> </span> </div> <?php } } if (!empty($api->contributors)) { ?> <h3><?php _e('Contributors'); ?> </h3> <ul class="contributors"> <?php foreach ((array) $api->contributors as $contrib_username => $contrib_profile) { if (empty($contrib_username) && empty($contrib_profile)) { continue; } if (empty($contrib_username)) { $contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile); } $contrib_username = sanitize_user($contrib_username); if (empty($contrib_profile)) { echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>"; } else { echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>"; } } ?> </ul> <?php if (!empty($api->donate_link)) { ?> <a target="_blank" href="<?php echo esc_url($api->donate_link); ?> "><?php _e('Donate to this plugin »'); ?> </a> <?php } ?> <?php } ?> </div> <div id="section-holder" class="wrap"> <?php if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) { echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been tested with your current version of WordPress.') . '</p></div>'; } else { if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) { echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been marked as compatible with your version of WordPress.') . '</p></div>'; } } foreach ((array) $api->sections as $section_name => $content) { $content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/'); $content = links_add_target($content, '_blank'); $san_section = esc_attr($section_name); $display = $section_name === $section ? 'block' : 'none'; if ('description' === $section_name && (!$api->external && $api->wp_org_missing || $api->external && $api->fs_missing)) { $missing_notice = array('type' => 'error', 'id' => md5(microtime()), 'message' => __fs($api->is_paid ? 'paid-addon-not-deployed' : 'free-addon-not-deployed', $api->slug)); fs_require_template('admin-notice.php', $missing_notice); } echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n"; echo $content; echo "\t</div>\n"; } echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; // #plugin-information-scrollable echo "<div id='{$tab}-footer'>\n"; echo $this->get_plugin_cta($api); echo "</div>\n"; iframe_footer(); exit; }
?> </th> <th><?php _efs('activated'); ?> </th> <th><?php _efs('blocking'); ?> </th> <th><?php _efs('license-key'); ?> </th> <th><?php _efs('expiration'); ?> </th> </tr> </thead> <tbody> <?php foreach ($licenses as $slug => $module_licenses) { ?> <?php foreach ($module_licenses as $id => $licenses) { ?> <?php if (is_array($licenses) && 0 < count($licenses)) { ?> <?php
</div> <!--<div class="fs-terms"> <a href="https://freemius.com/privacy/" target="_blank"><?php _efs('privacy-policy'); ?> </a> - <a href="https://freemius.com/terms/" target="_blank"><?php _efs('tos'); ?> </a> </div> --> </div> </div> <script type="text/javascript"> (function ($) { $('.button').on('click', function () { // Set loading mode. $(document.body).css({'cursor': 'wait'}); }); $('.button.button-primary').on('click', function () { $(this).html('<?php _efs('activating'); ?> ...').css({'cursor': 'wait'}); }); $('.fs-permissions .fs-trigger').on('click', function () { $('.fs-permissions').toggleClass('fs-open'); }); })(jQuery); </script>
} $.ajax({ url : ajaxurl, method : 'POST', data : { action: '<?php echo $fs->get_action_tag('resend_license_key'); ?> ', slug : moduleSlug, email : emailAddress }, beforeSend: function () { $sendLicenseKeyButton.text('<?php _efs('sending-license-key', $slug); ?> ...'); }, success : function (result) { var resultObj = $.parseJSON(result); if (resultObj.success) { closeModal(); } else { showError(resultObj.error); resetSendLicenseKeyButton(); } } }); }); }
?> </th> <th><?php _efs('email'); ?> </th> <th><?php _efs('verified'); ?> </th> <th><?php _efs('public-key'); ?> </th> <th><?php _efs('secret-key'); ?> </th> </tr> </thead> <tbody> <?php foreach ($users as $user_id => $user) { ?> <tr> <td><?php echo $user->id; ?> </td> <td><?php echo $user->get_name();
?> </th> <th><?php _efs('plugin'); ?> </th> <th><?php _efs('type'); ?> </th> <th><?php _efs('Last'); ?> </th> <th><?php _efs('Next'); ?> </th> </tr> </thead> <tbody> <?php foreach ($scheduled_crons as $slug => $crons) { ?> <?php foreach ($crons as $cron) { ?> <tr> <td><?php echo $slug; ?>
<div class="fs-terms"> <a href="https://freemius.com/privacy/" target="_blank"><?php _efs('privacy-policy', $slug); ?> </a> - <a href="https://freemius.com/terms/" target="_blank"><?php _efs('tos', $slug); ?> </a> </div> </div> <script type="text/javascript"> (function ($) { $('.button').on('click', function () { // Set loading mode. $(document.body).css({'cursor': 'wait'}); }); $('.button.button-primary').on('click', function () { $(this).addClass('fs-loading'); $(this).html('<?php _efs('activating', $slug); ?> ...').css({'cursor': 'wait'}); }); $('.fs-permissions .fs-trigger').on('click', function () { $('.fs-permissions').toggleClass('fs-open'); }); })(jQuery); </script>
_efs('Body'); ?> </th> <?php } ?> <th><?php _efs('Result'); ?> </th> <th><?php _efs('Start'); ?> </th> <th><?php _efs('End'); ?> </th> </tr> </thead> <tbody> <?php foreach ($logger as $log) { ?> <tr> <td><?php echo $log['id']; ?> .</td> <td><?php echo $log['method'];
<p><?php _efs('permissions-events_desc', $slug); ?> </p> </div> </li> </ul> </div> <div class="fs-terms"> <a href="https://freemius.com/privacy/" target="_blank"><?php _efs('privacy-policy', $slug); ?> </a> - <a href="https://freemius.com/terms/" target="_blank"><?php _efs('tos', $slug); ?> </a> </div> </div> <script type="text/javascript"> (function ($) { $('.button.button-primary').on('click', function () { $(document.body).css({'cursor': 'wait'}); $(this).html('Sending email...').css({'cursor': 'wait'}); }); $('.fs-permissions .fs-trigger').on('click', function () { $('.fs-permissions').toggleClass('fs-open'); }); })(jQuery); </script>
?> </td> <td><?php echo date('M j, Y', strtotime($payment->created)); ?> </td> <td>$<?php echo $payment->gross; ?> </td> <td><a href="<?php echo $fs->_get_invoice_api_url($payment->id); ?> " class="button button-small" target="_blank"><?php _efs('invoice', $slug); ?> </a></td> </tr> <?php $odd = !$odd; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div>
<p><?php _efs('permissions-events_desc'); ?> </p> </div> </li> </ul> </div> <div class="fs-terms"> <a href="https://freemius.com/privacy/" target="_blank"><?php _efs('privacy-policy'); ?> </a> - <a href="https://freemius.com/terms/" target="_blank"><?php _efs('tos'); ?> </a> </div> </div> <script type="text/javascript"> (function ($) { $('.button.button-primary').on('click', function () { $(document.body).css({'cursor': 'wait'}); $(this).html('Sending email...').css({'cursor': 'wait'}); }); $('.fs-permissions .fs-trigger').on('click', function () { $('.fs-permissions').toggleClass('fs-open'); }); })(jQuery); </script>
} ?> <div> <?php echo wp_kses($plugin->info->description, array('a' => array('href' => array(), 'title' => array(), 'target' => array()), 'b' => array(), 'i' => array(), 'p' => array(), 'blockquote' => array(), 'h2' => array(), 'h3' => array(), 'ul' => array(), 'ol' => array(), 'li' => array())); ?> </div> <?php if (!empty($plugin->info->screenshots)) { ?> <?php $screenshots = $plugin->info->screenshots; ?> <div class="fs-screenshots clearfix"> <h2><?php _efs('screenshots'); ?> </h2> <ul> <?php $i = 0; foreach ($screenshots as $s => $url) { ?> <?php // Relative URLs are replaced with WordPress.org base URL // therefore we need to set absolute URLs. $url = 'http' . (WP_FS__IS_HTTPS ? 's' : '') . ':' . $url; ?> <li class="<?php echo 0 === $i % 2 ? 'odd' : 'even'; ?>
?> </td> <td><?php echo $user->public_key; ?> </td> <td><?php echo $user->secret_key; ?> </td> </tr> <?php } ?> </tbody> </table> <br><br> <form action="" method="POST"> <input type="hidden" name="fs_action" value="delete_all_accounts"> <?php wp_nonce_field('delete_all_accounts'); ?> <button class="button button-primary" onclick="if (confirm('<?php _efs('delete-all-confirm'); ?> ')) this.parentNode.submit(); return false;"><?php _efs('delete-all-accounts'); ?> </button> </form>
/** * Display plugin information in dialog box form. * * @since 2.7.0 */ function fs_install_plugin_information() { global $tab; if (empty($_REQUEST['plugin'])) { return; } $args = array('slug' => wp_unslash($_REQUEST['plugin']), 'is_ssl' => is_ssl(), 'fields' => array('banners' => true, 'reviews' => true)); if (is_array($args)) { $args = (object) $args; } if (!isset($args->per_page)) { $args->per_page = 24; } if (!isset($args->locale)) { $args->locale = get_locale(); } $api = apply_filters('fs_plugins_api', false, 'plugin_information', $args); if (is_wp_error($api)) { wp_die($api); } $plugins_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array(), 'class' => array()), 'style' => array(), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'div' => array('class' => array()), 'span' => array('class' => array()), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array('class' => array()), 'i' => array('class' => array()), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), 'img' => array('src' => array(), 'class' => array(), 'alt' => array())); $plugins_section_titles = array('description' => _x('Description', 'Plugin installer section title'), 'installation' => _x('Installation', 'Plugin installer section title'), 'faq' => _x('FAQ', 'Plugin installer section title'), 'screenshots' => _x('Screenshots', 'Plugin installer section title'), 'changelog' => _x('Changelog', 'Plugin installer section title'), 'reviews' => _x('Reviews', 'Plugin installer section title'), 'other_notes' => _x('Other Notes', 'Plugin installer section title')); // Sanitize HTML // foreach ( (array) $api->sections as $section_name => $content ) { // $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags ); // } foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) { if (isset($api->{$key})) { $api->{$key} = wp_kses($api->{$key}, $plugins_allowedtags); } } // Add after $api->slug is ready. $plugins_section_titles['features'] = __fs('features-and-pricing', $api->slug); $_tab = esc_attr($tab); $section = isset($_REQUEST['section']) ? wp_unslash($_REQUEST['section']) : 'description'; // Default to the Description tab, Do not translate, API returns English. if (empty($section) || !isset($api->sections[$section])) { $section_titles = array_keys((array) $api->sections); $section = array_shift($section_titles); } iframe_header(__('Plugin Install')); $_with_banner = ''; // var_dump($api->banners); if (!empty($api->banners) && (!empty($api->banners['low']) || !empty($api->banners['high']))) { $_with_banner = 'with-banner'; $low = empty($api->banners['low']) ? $api->banners['high'] : $api->banners['low']; $high = empty($api->banners['high']) ? $api->banners['low'] : $api->banners['high']; ?> <style type="text/css"> #plugin-information-title.with-banner { background-image: url( <?php echo esc_url($low); ?> ); } @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 ) { #plugin-information-title.with-banner { background-image: url( <?php echo esc_url($high); ?> ); } } </style> <?php } echo '<div id="plugin-information-scrollable">'; echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>"; echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n"; foreach ((array) $api->sections as $section_name => $content) { if ('reviews' === $section_name && (empty($api->ratings) || 0 === array_sum((array) $api->ratings))) { continue; } if (isset($plugins_section_titles[$section_name])) { $title = $plugins_section_titles[$section_name]; } else { $title = ucwords(str_replace('_', ' ', $section_name)); } $class = $section_name === $section ? ' class="current"' : ''; $href = add_query_arg(array('tab' => $tab, 'section' => $section_name)); $href = esc_url($href); $san_section = esc_attr($section_name); echo "\t<a name='{$san_section}' href='{$href}' {$class}>{$title}</a>\n"; } echo "</div>\n"; ?> <div id="<?php echo $_tab; ?> -content" class='<?php echo $_with_banner; ?> '> <div class="fyi"> <?php if (isset($api->plans)) { ?> <div class="plugin-information-pricing"> <?php foreach ($api->plans as $plan) { ?> <h3 data-plan="<?php echo $plan->id; ?> "><?php printf(__fs('x-plan', $api->slug), $plan->title); ?> </h3> <ul> <?php $billing_cycle = 'annual'; ?> <?php if (1 === count($plan->pricing) && 1 == $plan->pricing[0]->licenses) { ?> <?php $pricing = $plan->pricing[0]; ?> <li><label><?php _efs('price', $api->slug); ?> : $<?php if (isset($pricing->annual_price)) { echo $pricing->annual_price . ($plan->is_block_features ? ' / year' : ''); $billing_cycle = 'annual'; } else { if (isset($pricing->monthly_price)) { echo $pricing->monthly_price . ' / mo'; $billing_cycle = 'monthly'; } else { if (isset($pricing->lifetime_price)) { echo $pricing->lifetime_price; $billing_cycle = 'lifetime'; } } } ?> </label></li> <?php } else { ?> <?php $first = true; foreach ($plan->pricing as $pricing) { ?> <li><label><input name="pricing-<?php echo $plan->id; ?> " type="radio" value="<?php echo $pricing->id; ?> "<?php checked($first, true); ?> ><?php switch ($pricing->licenses) { case '1': _efs('license-single-site', $api->slug); break; case null: _efs('license-unlimited', $api->slug); break; default: printf(__fs('license-x-sites', $api->slug), $pricing->licenses); break; } ?> - $<?php if (isset($pricing->annual_price)) { echo $pricing->annual_price . ($plan->is_block_features ? ' / year' : ''); $billing_cycle = 'annual'; } else { if (isset($pricing->monthly_price)) { echo $pricing->monthly_price . ' / mo'; $billing_cycle = 'monthly'; } else { if (isset($pricing->lifetime_price)) { echo $pricing->lifetime_price; $billing_cycle = 'lifetime'; } } } ?> </label></li> <?php $first = false; } ?> <?php } ?> </ul> <?php echo ' <a class="button button-primary right" href="' . esc_url(add_query_arg(array('plugin_id' => $plan->plugin_id, 'plan_id' => $plan->id, 'pricing_id' => $plan->pricing[0]->id, 'billing_cycle' => $billing_cycle), $api->checkout_link)) . '" target="_parent">' . __fs('purchase', $api->slug) . '</a>'; ?> </div> <?php } ?> <?php wp_enqueue_script('jquery'); ?> <script type="text/javascript"> (function ($) { $('.plugin-information-pricing input[type=radio]').click(function () { var checkout_url = '<?php echo esc_url_raw(add_query_arg(array('plugin_id' => $plan->plugin_id, 'billing_cycle' => $billing_cycle), $api->checkout_link)); ?> &plan_id=' + $(this).parents('.plugin-information-pricing').find('h3').attr('data-plan') + '&pricing_id=' + $(this).val(); $('.plugin-information-pricing .button, #plugin-information-footer .button').attr('href', checkout_url); }); })(jQuery); </script> <?php } ?> <div> <h3><?php _efs('details', $api->slug); ?> </h3> <ul> <?php if (!empty($api->version)) { ?> <li><strong><?php _e('Version:'); ?> </strong> <?php echo $api->version; ?> </li> <?php } if (!empty($api->author)) { ?> <li> <strong><?php _e('Author:'); ?> </strong> <?php echo links_add_target($api->author, '_blank'); ?> </li> <?php } if (!empty($api->last_updated)) { ?> <li><strong><?php _e('Last Updated:'); ?> </strong> <span title="<?php echo $api->last_updated; ?> "> <?php printf(__('%s ago'), human_time_diff(strtotime($api->last_updated))); ?> </span></li> <?php } if (!empty($api->requires)) { ?> <li> <strong><?php _e('Requires WordPress Version:'); ?> </strong> <?php printf(__('%s or higher'), $api->requires); ?> </li> <?php } if (!empty($api->tested)) { ?> <li><strong><?php _e('Compatible up to:'); ?> </strong> <?php echo $api->tested; ?> </li> <?php } if (!empty($api->downloaded)) { ?> <li> <strong><?php _e('Downloaded:'); ?> </strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)); ?> </li> <?php } if (!empty($api->slug) && empty($api->external)) { ?> <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?> /"><?php _e('WordPress.org Plugin Page »'); ?> </a> </li> <?php } if (!empty($api->homepage)) { ?> <li><a target="_blank" href="<?php echo esc_url($api->homepage); ?> "><?php _e('Plugin Homepage »'); ?> </a> </li> <?php } if (!empty($api->donate_link) && empty($api->contributors)) { ?> <li><a target="_blank" href="<?php echo esc_url($api->donate_link); ?> "><?php _e('Donate to this plugin »'); ?> </a> </li> <?php } ?> </ul> </div> <?php if (!empty($api->rating)) { ?> <h3><?php _e('Average Rating'); ?> </h3> <?php wp_star_rating(array('rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings)); ?> <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?> </small> <?php } if (!empty($api->ratings) && array_sum((array) $api->ratings) > 0) { foreach ($api->ratings as $key => $ratecount) { // Avoid div-by-zero. $_rating = $api->num_ratings ? $ratecount / $api->num_ratings : 0; ?> <div class="counter-container"> <span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?> ?filter=<?php echo $key; ?> " target="_blank" title="<?php echo esc_attr(sprintf(_n('Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key), $key)); ?> "><?php printf(_n('%d star', '%d stars', $key), $key); ?> </a></span> <span class="counter-back"> <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?> px;"></span> </span> <span class="counter-count"><?php echo number_format_i18n($ratecount); ?> </span> </div> <?php } } if (!empty($api->contributors)) { ?> <h3><?php _e('Contributors'); ?> </h3> <ul class="contributors"> <?php foreach ((array) $api->contributors as $contrib_username => $contrib_profile) { if (empty($contrib_username) && empty($contrib_profile)) { continue; } if (empty($contrib_username)) { $contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile); } $contrib_username = sanitize_user($contrib_username); if (empty($contrib_profile)) { echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>"; } else { echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>"; } } ?> </ul> <?php if (!empty($api->donate_link)) { ?> <a target="_blank" href="<?php echo esc_url($api->donate_link); ?> "><?php _e('Donate to this plugin »'); ?> </a> <?php } ?> <?php } ?> </div> <div id="section-holder" class="wrap"> <?php if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) { echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been tested with your current version of WordPress.') . '</p></div>'; } else { if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) { echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been marked as compatible with your version of WordPress.') . '</p></div>'; } } foreach ((array) $api->sections as $section_name => $content) { $content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/'); $content = links_add_target($content, '_blank'); $san_section = esc_attr($section_name); $display = $section_name === $section ? 'block' : 'none'; echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n"; echo $content; echo "\t</div>\n"; } echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; // #plugin-information-scrollable echo "<div id='{$tab}-footer'>\n"; if (current_user_can('install_plugins') || current_user_can('update_plugins')) { if (!empty($api->checkout_link) && isset($api->plans) && 0 < is_array($api->plans)) { echo ' <a class="button button-primary right" href="' . esc_url(add_query_arg(array('plugin_id' => $plan->plugin_id, 'plan_id' => $plan->id, 'pricing_id' => $plan->pricing[0]->id, 'billing_cycle' => $billing_cycle), $api->checkout_link)) . '" target="_parent">' . __fs('purchase', $api->slug) . '</a>'; // @todo Add Cart concept. // echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>'; } else { if (!empty($api->download_link)) { $status = install_plugin_install_status($api); switch ($status['status']) { case 'install': if ($status['url']) { echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>'; } break; case 'update_available': if ($status['url']) { echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>'; } break; case 'newer_installed': echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>'; break; case 'latest_installed': echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>'; break; } } } } echo "</div>\n"; iframe_footer(); exit; }
?> </th> <th><?php _efs('function'); ?> </th> <th><?php _efs('message'); ?> </th> <th><?php _efs('file'); ?> </th> <th><?php _efs('timestamp'); ?> </th> </tr> </thead> <tbody> <?php $i = 0; foreach ($log_book as $log) { ?> <tr<?php if ($i % 2) { echo ' class="alternate"'; } ?>
echo $addon->title; ?> </li> <li class="fs-offer"> <span class="fs-price"><?php echo 0 == $price ? __fs('free', $slug) : '$' . number_format($price, 2) . ($plan->has_trial() ? ' - ' . __fs('trial', $slug) : ''); ?> </span> </li> <li class="fs-description"><?php echo !empty($addon->info->short_description) ? $addon->info->short_description : 'SHORT DESCRIPTION'; ?> </li> <li class="fs-cta"><a class="button"><?php _efs('view-details', $slug); ?> </a></li> </ul> </div> </li> <?php } ?> <?php } ?> </ul> </div> </div> <script type="text/javascript">
} ?> <div> <?php echo wp_kses($plugin->info->description, array('a' => array('href' => array(), 'title' => array(), 'target' => array()), 'b' => array(), 'i' => array(), 'p' => array(), 'blockquote' => array(), 'h2' => array(), 'h3' => array(), 'ul' => array(), 'ol' => array(), 'li' => array())); ?> </div> <?php if (!empty($plugin->info->screenshots)) { ?> <?php $screenshots = $plugin->info->screenshots; ?> <div class="fs-screenshots clearfix"> <h2><?php _efs('screenshots', $plugin->slug); ?> </h2> <ul> <?php $i = 0; foreach ($screenshots as $s => $url) { ?> <?php // Relative URLs are replaced with WordPress.org base URL // therefore we need to set absolute URLs. $url = 'http' . (WP_FS__IS_HTTPS ? 's' : '') . ':' . $url; ?> <li class="<?php echo 0 === $i % 2 ? 'odd' : 'even'; ?>
href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $addon->slug), 'install-plugin_' . $addon->slug); ?> "><?php _efs('install-now'); ?> </a> <?php } else { ?> <a target="_blank" class="button button-primary" href="<?php echo $fs->_get_latest_download_local_url($addon_id); ?> "><?php _efs('download-latest'); ?> </a> <?php } ?> <?php } ?> </td> <?php } ?> <?php if (defined('WP_FS__DEV_MODE') && WP_FS__DEV_MODE) { ?>
?> <script type="text/javascript"> (function ($) { var reasonsHtml = <?php echo json_encode($reasons_list_items_html); ?> , modalHtml = '<div class="fs-modal fs-modal-deactivation-feedback<?php echo empty($confirmation_message) ? ' no-confirmation-message' : ''; ?> ">' + ' <div class="fs-modal-dialog">' + ' <div class="fs-modal-header">' + ' <h4><?php _efs('quick-feedback', $slug); ?> </h4>' + ' </div>' + ' <div class="fs-modal-body">' + ' <div class="fs-modal-panel" data-panel-id="confirm"><p><?php echo $confirmation_message; ?> </p></div>' + ' <div class="fs-modal-panel active" data-panel-id="reasons"><h3><strong><?php printf(__fs('deactivation-share-reason', $slug)); ?> :</strong></h3><ul id="reasons-list">' + reasonsHtml + '</ul></div>' + ' </div>' + ' <div class="fs-modal-footer">' + ' <?php
<div class="fs-terms"> <a href="https://freemius.com/privacy/" target="_blank"><?php _efs('privacy-policy', $slug); ?> </a> - <a href="https://freemius.com/terms/" target="_blank"><?php _efs('tos', $slug); ?> </a> </div> </div> <script type="text/javascript"> (function ($) { $('.button').on('click', function () { // Set loading mode. $(document.body).css({'cursor': 'wait'}); }); $('.button.button-primary').on('click', function () { $(this).addClass('fs-loading'); $(this).html('<?php _efs($is_pending_activation ? 'sending-email' : 'activating', $slug); ?> ...').css({'cursor': 'wait'}); }); $('.fs-permissions .fs-trigger').on('click', function () { $('.fs-permissions').toggleClass('fs-open'); }); })(jQuery); </script>
if (0 === licenseKey.length) { return; } $.ajax({ url: ajaxurl, method: 'POST', data: { action : 'fs_activate_license_' + pluginSlug, slug : pluginSlug, license_key: licenseKey }, beforeSend: function () { $activateLicenseButton.text( '<?php _efs('activating-license', $slug); ?> ' ); }, success: function( result ) { var resultObj = $.parseJSON( result ); if ( resultObj.success ) { closeModal(); // Redirect to the "Account" page and sync the license. window.location.href = afterActivationUrl; } else { showError( resultObj.error ); resetActivateLicenseButton(); } }
href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $addon->slug), 'install-plugin_' . $addon->slug); ?> "><?php _efs('install-now', $slug); ?> </a> <?php } else { ?> <a target="_blank" class="button button-primary" href="<?php echo $fs->_get_latest_download_local_url($addon_id); ?> "><?php _efs('download-latest', $slug); ?> </a> <?php } ?> <?php } ?> </td> <?php } ?> <?php if (defined('WP_FS__DEV_MODE') && WP_FS__DEV_MODE) { ?>
} else { printf(__fs('x-ago'), $human_diff); } } ?> </td> </tr> <?php } ?> <?php if (is_object($all_themes)) { ?> <tr> <td><?php _efs('themes'); ?> </td> <td><?php echo count($all_themes->themes); ?> </td> <td><?php if (isset($all_themes->timestamp) && is_numeric($all_themes->timestamp)) { $diff = abs(WP_FS__SCRIPT_START_TIME - $all_themes->timestamp); $human_diff = $diff < MINUTE_IN_SECONDS ? $diff . ' ' . __fs('sec') : human_time_diff(WP_FS__SCRIPT_START_TIME, $all_themes->timestamp); if (WP_FS__SCRIPT_START_TIME < $all_themes->timestamp) { printf(__fs('in-x'), $human_diff); } else { printf(__fs('x-ago'), $human_diff); }