Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/template...
File: pricing.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package Freemius
[2] Fix | Delete
* @copyright Copyright (c) 2015, Freemius, Inc.
[3] Fix | Delete
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
[4] Fix | Delete
* @since 1.0.3
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Note for WordPress.org Theme/Plugin reviewer:
[9] Fix | Delete
* Freemius is an SDK for plugin and theme developers. Since the core
[10] Fix | Delete
* of the SDK is relevant both for plugins and themes, for obvious reasons,
[11] Fix | Delete
* we only develop and maintain one code base.
[12] Fix | Delete
*
[13] Fix | Delete
* This code (and page) will not run for wp.org themes (only plugins).
[14] Fix | Delete
*
[15] Fix | Delete
* In addition, this page loads an i-frame. We intentionally named it 'frame'
[16] Fix | Delete
* so it will pass the "Theme Check" that is looking for the string "i" . "frame".
[17] Fix | Delete
*
[18] Fix | Delete
* UPDATE:
[19] Fix | Delete
* After ongoing conversations with the WordPress.org TRT we received
[20] Fix | Delete
* an official approval for including i-frames in the theme's WP Admin setting's
[21] Fix | Delete
* page tab (the SDK will never add any i-frames on the sitefront). i-frames
[22] Fix | Delete
* were never against the guidelines, but we wanted to get the team's blessings
[23] Fix | Delete
* before we move forward. For the record, I got the final approval from
[24] Fix | Delete
* Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
[25] Fix | Delete
* Europe 2017 (June 16th, 2017).
[26] Fix | Delete
*
[27] Fix | Delete
* If you have any questions or need clarifications, please don't hesitate
[28] Fix | Delete
* pinging me on slack, my username is @svovaf.
[29] Fix | Delete
*
[30] Fix | Delete
* @author Vova Feldman (@svovaf)
[31] Fix | Delete
* @since 1.2.2
[32] Fix | Delete
*/
[33] Fix | Delete
[34] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[35] Fix | Delete
exit;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
wp_enqueue_script( 'jquery' );
[39] Fix | Delete
wp_enqueue_script( 'json2' );
[40] Fix | Delete
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
[41] Fix | Delete
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
[42] Fix | Delete
fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* @var array $VARS
[46] Fix | Delete
* @var Freemius $fs
[47] Fix | Delete
*/
[48] Fix | Delete
$fs = freemius( $VARS['id'] );
[49] Fix | Delete
$slug = $fs->get_slug();
[50] Fix | Delete
$timestamp = time();
[51] Fix | Delete
[52] Fix | Delete
$context_params = array(
[53] Fix | Delete
'plugin_id' => $fs->get_id(),
[54] Fix | Delete
'plugin_public_key' => $fs->get_public_key(),
[55] Fix | Delete
'plugin_version' => $fs->get_plugin_version(),
[56] Fix | Delete
);
[57] Fix | Delete
[58] Fix | Delete
$bundle_id = $fs->get_bundle_id();
[59] Fix | Delete
if ( ! is_null( $bundle_id ) ) {
[60] Fix | Delete
$context_params['bundle_id'] = $bundle_id;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
// Get site context secure params.
[64] Fix | Delete
if ( $fs->is_registered() ) {
[65] Fix | Delete
$context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
[66] Fix | Delete
$fs->get_site(),
[67] Fix | Delete
$timestamp,
[68] Fix | Delete
'upgrade'
[69] Fix | Delete
) );
[70] Fix | Delete
} else {
[71] Fix | Delete
$context_params['home_url'] = home_url();
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
if ( $fs->is_payments_sandbox() ) // Append plugin secure token for sandbox mode authentication.)
[75] Fix | Delete
{
[76] Fix | Delete
$context_params['sandbox'] = FS_Security::instance()->get_secure_token(
[77] Fix | Delete
$fs->get_plugin(),
[78] Fix | Delete
$timestamp,
[79] Fix | Delete
'checkout'
[80] Fix | Delete
);
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
$query_params = array_merge( $context_params, $_GET, array(
[84] Fix | Delete
'next' => $fs->_get_sync_license_url( false, false ),
[85] Fix | Delete
'plugin_version' => $fs->get_plugin_version(),
[86] Fix | Delete
// Billing cycle.
[87] Fix | Delete
'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
[88] Fix | Delete
'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
[89] Fix | Delete
'currency' => $fs->apply_filters( 'default_currency', 'usd' ),
[90] Fix | Delete
'discounts_model' => $fs->apply_filters( 'pricing/discounts_model', 'absolute' ),
[91] Fix | Delete
) );
[92] Fix | Delete
[93] Fix | Delete
$use_external_pricing = $fs->should_use_external_pricing();
[94] Fix | Delete
[95] Fix | Delete
if ( ! $use_external_pricing ) {
[96] Fix | Delete
$pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
[97] Fix | Delete
wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
[98] Fix | Delete
} else {
[99] Fix | Delete
if ( ! $fs->is_registered() ) {
[100] Fix | Delete
$template_data = array(
[101] Fix | Delete
'id' => $fs->get_id(),
[102] Fix | Delete
);
[103] Fix | Delete
fs_require_template( 'forms/trial-start.php', $template_data);
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
$view_params = array(
[107] Fix | Delete
'id' => $VARS['id'],
[108] Fix | Delete
'page' => strtolower( $fs->get_text_x_inline( 'Pricing', 'noun', 'pricing' ) ),
[109] Fix | Delete
);
[110] Fix | Delete
fs_require_once_template('secure-https-header.php', $view_params);
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
$has_tabs = $fs->_add_tabs_before_content();
[114] Fix | Delete
[115] Fix | Delete
if ( $has_tabs ) {
[116] Fix | Delete
$query_params['tabs'] = 'true';
[117] Fix | Delete
}
[118] Fix | Delete
?>
[119] Fix | Delete
<div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
[120] Fix | Delete
<?php if ( ! $use_external_pricing ) : ?>
[121] Fix | Delete
<div id="fs_pricing_wrapper" data-public-url="<?php echo trailingslashit( dirname( $pricing_js_url ) ) ?>"></div>
[122] Fix | Delete
<?php
[123] Fix | Delete
$pricing_config = array_merge( array(
[124] Fix | Delete
'contact_url' => $fs->contact_url(),
[125] Fix | Delete
'is_production' => ( defined( 'WP_FS__IS_PRODUCTION_MODE' ) ? WP_FS__IS_PRODUCTION_MODE : null ),
[126] Fix | Delete
'menu_slug' => $fs->get_menu_slug(),
[127] Fix | Delete
'mode' => 'dashboard',
[128] Fix | Delete
'fs_wp_endpoint_url' => WP_FS__ADDRESS,
[129] Fix | Delete
'request_handler_url' => admin_url(
[130] Fix | Delete
'admin-ajax.php?' . http_build_query( array(
[131] Fix | Delete
'module_id' => $fs->get_id(),
[132] Fix | Delete
'action' => $fs->get_ajax_action( 'pricing_ajax_action' ),
[133] Fix | Delete
'security' => $fs->get_ajax_security( 'pricing_ajax_action' )
[134] Fix | Delete
) )
[135] Fix | Delete
),
[136] Fix | Delete
'selector' => '#fs_pricing_wrapper',
[137] Fix | Delete
'unique_affix' => $fs->get_unique_affix(),
[138] Fix | Delete
'show_annual_in_monthly' => $fs->apply_filters( 'pricing/show_annual_in_monthly', true ),
[139] Fix | Delete
), $query_params );
[140] Fix | Delete
[141] Fix | Delete
wp_add_inline_script( 'freemius-pricing', 'Freemius.pricing.new( ' . json_encode( $pricing_config ) . ' )' );
[142] Fix | Delete
?>
[143] Fix | Delete
<?php else : ?>
[144] Fix | Delete
<div id="fs_frame"></div>
[145] Fix | Delete
<form action="" method="POST">
[146] Fix | Delete
<input type="hidden" name="user_id"/>
[147] Fix | Delete
<input type="hidden" name="user_email"/>
[148] Fix | Delete
<input type="hidden" name="site_id"/>
[149] Fix | Delete
<input type="hidden" name="public_key"/>
[150] Fix | Delete
<input type="hidden" name="secret_key"/>
[151] Fix | Delete
<input type="hidden" name="action" value="account"/>
[152] Fix | Delete
</form>
[153] Fix | Delete
[154] Fix | Delete
<script type="text/javascript">
[155] Fix | Delete
(function ($, undef) {
[156] Fix | Delete
$(function () {
[157] Fix | Delete
var
[158] Fix | Delete
// Keep track of the i-frame height.
[159] Fix | Delete
frame_height = 800,
[160] Fix | Delete
base_url = '<?php echo WP_FS__ADDRESS ?>',
[161] Fix | Delete
// Pass the parent page URL into the i-frame in a meaningful way (this URL could be
[162] Fix | Delete
// passed via query string or hard coded into the child page, it depends on your needs).
[163] Fix | Delete
src = base_url + '/pricing/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
[164] Fix | Delete
[165] Fix | Delete
// Append the I-frame into the DOM.
[166] Fix | Delete
frame = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent; width: 1px; min-width: 100%;"><\/i' + 'frame>')
[167] Fix | Delete
.appendTo('#fs_frame');
[168] Fix | Delete
[169] Fix | Delete
FS.PostMessage.init(base_url, [frame[0]]);
[170] Fix | Delete
[171] Fix | Delete
FS.PostMessage.receive('height', function (data) {
[172] Fix | Delete
var h = data.height;
[173] Fix | Delete
if (!isNaN(h) && h > 0 && h != frame_height) {
[174] Fix | Delete
frame_height = h;
[175] Fix | Delete
frame.height(frame_height + 'px');
[176] Fix | Delete
[177] Fix | Delete
FS.PostMessage.postScroll(frame[0]);
[178] Fix | Delete
}
[179] Fix | Delete
});
[180] Fix | Delete
[181] Fix | Delete
FS.PostMessage.receive('get_dimensions', function (data) {
[182] Fix | Delete
FS.PostMessage.post('dimensions', {
[183] Fix | Delete
height : $(document.body).height(),
[184] Fix | Delete
scrollTop: $(document).scrollTop()
[185] Fix | Delete
}, frame[0]);
[186] Fix | Delete
});
[187] Fix | Delete
[188] Fix | Delete
FS.PostMessage.receive('start_trial', function (data) {
[189] Fix | Delete
openTrialConfirmationModal(data);
[190] Fix | Delete
});
[191] Fix | Delete
});
[192] Fix | Delete
})(jQuery);
[193] Fix | Delete
</script>
[194] Fix | Delete
<?php endif ?>
[195] Fix | Delete
</div>
[196] Fix | Delete
<?php
[197] Fix | Delete
if ( $has_tabs ) {
[198] Fix | Delete
$fs->_add_tabs_after_content();
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
$params = array(
[202] Fix | Delete
'page' => 'pricing',
[203] Fix | Delete
'module_id' => $fs->get_id(),
[204] Fix | Delete
'module_type' => $fs->get_module_type(),
[205] Fix | Delete
'module_slug' => $slug,
[206] Fix | Delete
'module_version' => $fs->get_plugin_version(),
[207] Fix | Delete
);
[208] Fix | Delete
fs_require_template( 'powered-by.php', $params );
[209] Fix | Delete
[210] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function