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/embedpre.../EmbedPre.../Includes/Traits
File: Shared.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace EmbedPress\Includes\Traits;
[2] Fix | Delete
[3] Fix | Delete
[4] Fix | Delete
if (!defined('ABSPATH')) {
[5] Fix | Delete
exit;
[6] Fix | Delete
} // Exit if accessed directly
[7] Fix | Delete
use \EmbedPress\Includes\Classes\EmbedPress_Plugin_Usage_Tracker;
[8] Fix | Delete
use \EmbedPress\Includes\Classes\EmbedPress_Notice;
[9] Fix | Delete
[10] Fix | Delete
use PriyoMukul\WPNotice\Notices;
[11] Fix | Delete
[12] Fix | Delete
use PriyoMukul\WPNotice\Utils\CacheBank;
[13] Fix | Delete
use PriyoMukul\WPNotice\Utils\NoticeRemover;
[14] Fix | Delete
[15] Fix | Delete
trait Shared
[16] Fix | Delete
{
[17] Fix | Delete
[18] Fix | Delete
private $insights = null;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* @var CacheBank
[22] Fix | Delete
*/
[23] Fix | Delete
private static $cache_bank;
[24] Fix | Delete
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Optional usage tracker
[28] Fix | Delete
*
[29] Fix | Delete
* @since v1.0.0
[30] Fix | Delete
*/
[31] Fix | Delete
public function start_plugin_tracking()
[32] Fix | Delete
{
[33] Fix | Delete
$this->insights = $tracker = EmbedPress_Plugin_Usage_Tracker::get_instance(EMBEDPRESS_FILE, [
[34] Fix | Delete
'opt_in' => true,
[35] Fix | Delete
'goodbye_form' => true,
[36] Fix | Delete
'item_id' => '98ba0ac16a4f7b3b940d'
[37] Fix | Delete
]);
[38] Fix | Delete
$tracker->set_notice_options(array(
[39] Fix | Delete
'notice' => __('Want to help make <strong>EmbedPress</strong> even more awesome? You can get a <strong>10% discount coupon</strong> for Premium extensions if you allow us to track the usage.', 'embedpress'),
[40] Fix | Delete
'extra_notice' => __('We collect non-sensitive diagnostic data and plugin usage information.
[41] Fix | Delete
Your site URL, WordPress & PHP version, plugins & themes and email address to send you the
[42] Fix | Delete
discount coupon. This data lets us make sure this plugin always stays compatible with the most
[43] Fix | Delete
popular plugins and themes. No spam, I promise.', 'embedpress'),
[44] Fix | Delete
));
[45] Fix | Delete
$tracker->init();
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
public function admin_notice()
[49] Fix | Delete
{
[50] Fix | Delete
[51] Fix | Delete
self::$cache_bank = CacheBank::get_instance();
[52] Fix | Delete
[53] Fix | Delete
try {
[54] Fix | Delete
$this->notices();
[55] Fix | Delete
} catch (Exception $e) {
[56] Fix | Delete
unset($e);
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
// Remove OLD notice from 1.0.0 (if other WPDeveloper plugin has notice)
[60] Fix | Delete
NoticeRemover::get_instance('1.0.0');
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
public function notices()
[64] Fix | Delete
{
[65] Fix | Delete
$_assets_url = plugins_url('assets/', EMBEDPRESS_PLUGIN_BASENAME);
[66] Fix | Delete
[67] Fix | Delete
$notices = new Notices([
[68] Fix | Delete
'id' => 'embedpress',
[69] Fix | Delete
'storage_key' => 'notices',
[70] Fix | Delete
'lifetime' => 3,
[71] Fix | Delete
'stylesheet_url' => $_assets_url . 'css/admin-notices.css',
[72] Fix | Delete
'styles' => $_assets_url . 'css/admin-notices.css',
[73] Fix | Delete
'priority' => 6
[74] Fix | Delete
]);
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* This is review message and thumbnail.
[78] Fix | Delete
*/
[79] Fix | Delete
$_review_notice = [
[80] Fix | Delete
'thumbnail' => $_assets_url . 'images/icon-128x128.png',
[81] Fix | Delete
'html' => '<p>' . __('We hope you\'re enjoying EmbedPress! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'embedpress') . '</p>',
[82] Fix | Delete
'links' => [
[83] Fix | Delete
'later' => array(
[84] Fix | Delete
'link' => 'https://wordpress.org/support/plugin/embedpress/reviews/',
[85] Fix | Delete
'target' => '_blank',
[86] Fix | Delete
'label' => __('Ok, you deserve it!', 'wp-scheduled-posts'),
[87] Fix | Delete
'icon_class' => 'dashicons dashicons-external',
[88] Fix | Delete
),
[89] Fix | Delete
'allready' => array(
[90] Fix | Delete
'label' => __('I already did', 'wp-scheduled-posts'),
[91] Fix | Delete
'icon_class' => 'dashicons dashicons-smiley',
[92] Fix | Delete
'attributes' => [
[93] Fix | Delete
'data-dismiss' => true
[94] Fix | Delete
],
[95] Fix | Delete
),
[96] Fix | Delete
'maybe_later' => array(
[97] Fix | Delete
'label' => __('Maybe Later', 'wp-scheduled-posts'),
[98] Fix | Delete
'icon_class' => 'dashicons dashicons-calendar-alt',
[99] Fix | Delete
'attributes' => [
[100] Fix | Delete
'data-later' => true
[101] Fix | Delete
],
[102] Fix | Delete
),
[103] Fix | Delete
'support' => array(
[104] Fix | Delete
'link' => 'https://wpdeveloper.com/support',
[105] Fix | Delete
'label' => __('I need help', 'wp-scheduled-posts'),
[106] Fix | Delete
'icon_class' => 'dashicons dashicons-sos',
[107] Fix | Delete
),
[108] Fix | Delete
'never_show_again' => array(
[109] Fix | Delete
'label' => __('Never show again', 'wp-scheduled-posts'),
[110] Fix | Delete
'icon_class' => 'dashicons dashicons-dismiss',
[111] Fix | Delete
'attributes' => [
[112] Fix | Delete
'data-dismiss' => true
[113] Fix | Delete
],
[114] Fix | Delete
),
[115] Fix | Delete
],
[116] Fix | Delete
];
[117] Fix | Delete
[118] Fix | Delete
$notices->add(
[119] Fix | Delete
'review',
[120] Fix | Delete
$_review_notice,
[121] Fix | Delete
[
[122] Fix | Delete
'start' => $notices->strtotime('+15 day'),
[123] Fix | Delete
'recurrence' => 30,
[124] Fix | Delete
'dismissible' => true,
[125] Fix | Delete
'refresh' => EMBEDPRESS_VERSION,
[126] Fix | Delete
]
[127] Fix | Delete
);
[128] Fix | Delete
[129] Fix | Delete
$notices->add(
[130] Fix | Delete
'optin',
[131] Fix | Delete
[$this->insights, 'notice'],
[132] Fix | Delete
[
[133] Fix | Delete
'start' => $notices->strtotime('+10 day'),
[134] Fix | Delete
'recurrence' => 30,
[135] Fix | Delete
'dismissible' => true,
[136] Fix | Delete
'refresh' => EMBEDPRESS_VERSION,
[137] Fix | Delete
'do_action' => 'wpdeveloper_notice_clicked_for_embedpress',
[138] Fix | Delete
'display_if' => !is_array($notices->is_installed('embedpress-pro/embedpress-pro.php'))
[139] Fix | Delete
]
[140] Fix | Delete
);
[141] Fix | Delete
[142] Fix | Delete
$b_message = '<p style="margin-top: 0; margin-bottom: 10px;">Black Friday Sale: Save up to 40% now & <strong>embed from 150+</strong> sources with advanced features ⚡</p><a class="button button-primary" href="https://wpdeveloper.com/upgrade/embedpress-bfcm" target="_blank">Upgrade to pro</a> <button data-dismiss="true" class="dismiss-btn button button-link">I don’t want to save money</button>';
[143] Fix | Delete
$_black_friday_notice = [
[144] Fix | Delete
'thumbnail' => $_assets_url . 'images/full-logo.svg',
[145] Fix | Delete
'html' => $b_message,
[146] Fix | Delete
];
[147] Fix | Delete
[148] Fix | Delete
$notices->add(
[149] Fix | Delete
'black_friday_notice',
[150] Fix | Delete
$_black_friday_notice,
[151] Fix | Delete
[
[152] Fix | Delete
'start' => $notices->time(),
[153] Fix | Delete
'recurrence' => false,
[154] Fix | Delete
'dismissible' => true,
[155] Fix | Delete
'refresh' => EMBEDPRESS_VERSION,
[156] Fix | Delete
"expire" => strtotime('11:59:59pm 2nd December, 2023'),
[157] Fix | Delete
'display_if' => !is_plugin_active('embedpress-pro/embedpress-pro.php')
[158] Fix | Delete
]
[159] Fix | Delete
);
[160] Fix | Delete
[161] Fix | Delete
$notices->init();
[162] Fix | Delete
[163] Fix | Delete
self::$cache_bank->create_account($notices);
[164] Fix | Delete
self::$cache_bank->calculate_deposits($notices);
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
public function is_pro_active()
[168] Fix | Delete
{
[169] Fix | Delete
return is_plugin_active('embedpress-pro/embedpress-pro.php');
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
/**
[173] Fix | Delete
* Show Admin notice when one of embedpress old plugin active
[174] Fix | Delete
*
[175] Fix | Delete
* @since 2.4.0
[176] Fix | Delete
*/
[177] Fix | Delete
public function embedpress_admin_notice()
[178] Fix | Delete
{ }
[179] Fix | Delete
}
[180] Fix | Delete
[181] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function