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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
}
[25500] Fix | Delete
[25501] Fix | Delete
echo '</div>';
[25502] Fix | Delete
[25503] Fix | Delete
return true;
[25504] Fix | Delete
}
[25505] Fix | Delete
[25506] Fix | Delete
#endregion
[25507] Fix | Delete
[25508] Fix | Delete
/**
[25509] Fix | Delete
* Add in-page JavaScript to inject the Freemius tabs into
[25510] Fix | Delete
* the module's setting tabs section.
[25511] Fix | Delete
*
[25512] Fix | Delete
* @author Vova Feldman (@svovaf)
[25513] Fix | Delete
* @since 1.2.2.7
[25514] Fix | Delete
*/
[25515] Fix | Delete
function _add_freemius_tabs() {
[25516] Fix | Delete
$this->_logger->entrance();
[25517] Fix | Delete
[25518] Fix | Delete
if ( ! $this->should_page_include_tabs() ) {
[25519] Fix | Delete
return;
[25520] Fix | Delete
}
[25521] Fix | Delete
[25522] Fix | Delete
$params = array( 'id' => $this->_module_id );
[25523] Fix | Delete
fs_require_once_template( 'tabs.php', $params );
[25524] Fix | Delete
}
[25525] Fix | Delete
[25526] Fix | Delete
#endregion
[25527] Fix | Delete
[25528] Fix | Delete
#--------------------------------------------------------------------------------
[25529] Fix | Delete
#region Customizer Integration for Themes
[25530] Fix | Delete
#--------------------------------------------------------------------------------
[25531] Fix | Delete
[25532] Fix | Delete
/**
[25533] Fix | Delete
* @author Vova Feldman (@svovaf)
[25534] Fix | Delete
* @since 1.2.2.7
[25535] Fix | Delete
*
[25536] Fix | Delete
* @param WP_Customize_Manager $customizer
[25537] Fix | Delete
*/
[25538] Fix | Delete
function _customizer_register( $customizer ) {
[25539] Fix | Delete
$this->_logger->entrance();
[25540] Fix | Delete
[25541] Fix | Delete
if ( $this->is_pricing_page_visible() ) {
[25542] Fix | Delete
require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-upsell-control.php';
[25543] Fix | Delete
[25544] Fix | Delete
$customizer->add_section( 'freemius_upsell', array(
[25545] Fix | Delete
'title' => '&#9733; ' . $this->get_text_inline( 'View paid features', 'view-paid-features' ),
[25546] Fix | Delete
'priority' => 1,
[25547] Fix | Delete
) );
[25548] Fix | Delete
$customizer->add_setting( 'freemius_upsell', array(
[25549] Fix | Delete
'sanitize_callback' => 'esc_html',
[25550] Fix | Delete
) );
[25551] Fix | Delete
[25552] Fix | Delete
$customizer->add_control( new FS_Customizer_Upsell_Control( $customizer, 'freemius_upsell', array(
[25553] Fix | Delete
'fs' => $this,
[25554] Fix | Delete
'section' => 'freemius_upsell',
[25555] Fix | Delete
'priority' => 100,
[25556] Fix | Delete
) ) );
[25557] Fix | Delete
}
[25558] Fix | Delete
[25559] Fix | Delete
if ( $this->is_page_visible( 'contact' ) || $this->is_page_visible( 'support' ) ) {
[25560] Fix | Delete
require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-support-section.php';
[25561] Fix | Delete
[25562] Fix | Delete
// Main Documentation Link In Customizer Root.
[25563] Fix | Delete
$customizer->add_section( new FS_Customizer_Support_Section( $customizer, 'freemius_support', array(
[25564] Fix | Delete
'fs' => $this,
[25565] Fix | Delete
'priority' => 1000,
[25566] Fix | Delete
) ) );
[25567] Fix | Delete
}
[25568] Fix | Delete
}
[25569] Fix | Delete
[25570] Fix | Delete
#endregion
[25571] Fix | Delete
[25572] Fix | Delete
/**
[25573] Fix | Delete
* If the theme has a paid version, add some custom
[25574] Fix | Delete
* styling to the theme's premium version (if exists)
[25575] Fix | Delete
* to highlight that it's the premium version of the
[25576] Fix | Delete
* same theme, making it easier for identification
[25577] Fix | Delete
* after the user upgrades and upload it to the site.
[25578] Fix | Delete
*
[25579] Fix | Delete
* @author Vova Feldman (@svovaf)
[25580] Fix | Delete
* @since 1.2.2.7
[25581] Fix | Delete
*/
[25582] Fix | Delete
function _style_premium_theme() {
[25583] Fix | Delete
$this->_logger->entrance();
[25584] Fix | Delete
[25585] Fix | Delete
if ( ! self::is_themes_page() ) {
[25586] Fix | Delete
// Only include in the themes page.
[25587] Fix | Delete
return;
[25588] Fix | Delete
}
[25589] Fix | Delete
[25590] Fix | Delete
if ( ! $this->has_paid_plan() ) {
[25591] Fix | Delete
// Only include if has any paid plans.
[25592] Fix | Delete
return;
[25593] Fix | Delete
}
[25594] Fix | Delete
[25595] Fix | Delete
$params = null;
[25596] Fix | Delete
fs_require_once_template( '/js/jquery.content-change.php', $params );
[25597] Fix | Delete
[25598] Fix | Delete
$params = array(
[25599] Fix | Delete
'slug' => $this->_slug,
[25600] Fix | Delete
'id' => $this->_module_id,
[25601] Fix | Delete
);
[25602] Fix | Delete
[25603] Fix | Delete
fs_require_template( '/js/style-premium-theme.php', $params );
[25604] Fix | Delete
}
[25605] Fix | Delete
[25606] Fix | Delete
/**
[25607] Fix | Delete
* This method will return the absolute URL of the module's local icon.
[25608] Fix | Delete
*
[25609] Fix | Delete
* When you are running your plugin or theme on a **localhost** environment, if the icon
[25610] Fix | Delete
* is not found in the local assets folder, try to fetch the icon URL from Freemius. If not set and
[25611] Fix | Delete
* it's a plugin hosted on WordPress.org, try fetching the icon URL from wordpress.org.
[25612] Fix | Delete
* If an icon is found, this method will automatically attempt to download the icon and store it
[25613] Fix | Delete
* in /freemius/assets/img/{slug}.{png|jpg|gif|svg}.
[25614] Fix | Delete
*
[25615] Fix | Delete
* It's important to mention that this method is NOT phoning home since the developer will deploy
[25616] Fix | Delete
* the product with the local icon in the assets folder. The download process just simplifies
[25617] Fix | Delete
* the process for the developer.
[25618] Fix | Delete
*
[25619] Fix | Delete
* @author Vova Feldman (@svovaf)
[25620] Fix | Delete
* @since 2.0.0
[25621] Fix | Delete
*
[25622] Fix | Delete
* @return string
[25623] Fix | Delete
*/
[25624] Fix | Delete
function get_local_icon_url() {
[25625] Fix | Delete
global $fs_active_plugins;
[25626] Fix | Delete
[25627] Fix | Delete
/**
[25628] Fix | Delete
* @since 1.1.7.5
[25629] Fix | Delete
*/
[25630] Fix | Delete
$local_path = $this->apply_filters( 'plugin_icon', false );
[25631] Fix | Delete
[25632] Fix | Delete
if ( is_string( $local_path ) ) {
[25633] Fix | Delete
$icons = array( $local_path );
[25634] Fix | Delete
} else {
[25635] Fix | Delete
$img_dir = WP_FS__DIR_IMG;
[25636] Fix | Delete
[25637] Fix | Delete
// Locate the main assets folder.
[25638] Fix | Delete
if ( 1 < count( $fs_active_plugins->plugins ) ) {
[25639] Fix | Delete
$plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) );
[25640] Fix | Delete
[25641] Fix | Delete
foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
[25642] Fix | Delete
if ( $data->plugin_path == $this->get_plugin_basename() ) {
[25643] Fix | Delete
$img_dir = $plugin_or_theme_img_dir
[25644] Fix | Delete
. '/'
[25645] Fix | Delete
/**
[25646] Fix | Delete
* The basename will be `themes` or the basename of a custom themes directory.
[25647] Fix | Delete
*
[25648] Fix | Delete
* @author Leo Fajardo (@leorw)
[25649] Fix | Delete
* @since 2.2.3
[25650] Fix | Delete
*/
[25651] Fix | Delete
. str_replace( '../' . basename( $plugin_or_theme_img_dir ) . '/', '', $sdk_path )
[25652] Fix | Delete
. '/assets/img';
[25653] Fix | Delete
[25654] Fix | Delete
break;
[25655] Fix | Delete
}
[25656] Fix | Delete
}
[25657] Fix | Delete
}
[25658] Fix | Delete
[25659] Fix | Delete
// Try to locate the icon in the assets folder.
[25660] Fix | Delete
$icons = glob( fs_normalize_path( $img_dir . "/{$this->_slug}.*" ) );
[25661] Fix | Delete
[25662] Fix | Delete
if ( ! is_array( $icons ) || 0 === count( $icons ) ) {
[25663] Fix | Delete
if ( ! WP_FS__IS_LOCALHOST && $this->is_theme() ) {
[25664] Fix | Delete
$icons = array(
[25665] Fix | Delete
fs_normalize_path( $img_dir . '/theme-icon.png' )
[25666] Fix | Delete
);
[25667] Fix | Delete
} else {
[25668] Fix | Delete
$icon_found = false;
[25669] Fix | Delete
$local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" );
[25670] Fix | Delete
[25671] Fix | Delete
if ( ! function_exists( 'get_filesystem_method' ) ) {
[25672] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/file.php';
[25673] Fix | Delete
}
[25674] Fix | Delete
[25675] Fix | Delete
$have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) );
[25676] Fix | Delete
[25677] Fix | Delete
/**
[25678] Fix | Delete
* IMPORTANT: THIS CODE WILL NEVER RUN AFTER THE PLUGIN IS IN THE REPO.
[25679] Fix | Delete
*
[25680] Fix | Delete
* This code will only be executed once during the testing
[25681] Fix | Delete
* of the plugin in a local environment. The plugin icon file WILL
[25682] Fix | Delete
* already exist in the assets folder when the plugin is deployed to
[25683] Fix | Delete
* the repository.
[25684] Fix | Delete
*/
[25685] Fix | Delete
if ( WP_FS__IS_LOCALHOST && $have_write_permissions ) {
[25686] Fix | Delete
// Fetch icon from Freemius.
[25687] Fix | Delete
$icon = $this->fetch_remote_icon_url();
[25688] Fix | Delete
[25689] Fix | Delete
// Fetch icon from WordPress.org.
[25690] Fix | Delete
if ( empty( $icon ) && $this->is_plugin() && $this->is_org_repo_compliant() ) {
[25691] Fix | Delete
if ( ! function_exists( 'plugins_api' ) ) {
[25692] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
[25693] Fix | Delete
}
[25694] Fix | Delete
[25695] Fix | Delete
$plugin_information = plugins_api( 'plugin_information', array(
[25696] Fix | Delete
'slug' => $this->_slug,
[25697] Fix | Delete
'fields' => array(
[25698] Fix | Delete
'sections' => false,
[25699] Fix | Delete
'tags' => false,
[25700] Fix | Delete
'icons' => true
[25701] Fix | Delete
)
[25702] Fix | Delete
) );
[25703] Fix | Delete
[25704] Fix | Delete
if (
[25705] Fix | Delete
! is_wp_error( $plugin_information )
[25706] Fix | Delete
&& isset( $plugin_information->icons )
[25707] Fix | Delete
&& ! empty( $plugin_information->icons )
[25708] Fix | Delete
) {
[25709] Fix | Delete
/**
[25710] Fix | Delete
* Get the smallest icon.
[25711] Fix | Delete
*
[25712] Fix | Delete
* @author Leo Fajardo (@leorw)
[25713] Fix | Delete
* @since 1.2.2
[25714] Fix | Delete
*/
[25715] Fix | Delete
$icon = end( $plugin_information->icons );
[25716] Fix | Delete
}
[25717] Fix | Delete
}
[25718] Fix | Delete
[25719] Fix | Delete
if ( ! empty( $icon ) ) {
[25720] Fix | Delete
if ( 0 !== strpos( $icon, 'http' ) ) {
[25721] Fix | Delete
$icon = 'http:' . $icon;
[25722] Fix | Delete
}
[25723] Fix | Delete
[25724] Fix | Delete
/**
[25725] Fix | Delete
* Get a clean file extension, e.g.: "jpg" and not "jpg?rev=1305765".
[25726] Fix | Delete
*
[25727] Fix | Delete
* @author Leo Fajardo (@leorw)
[25728] Fix | Delete
* @since 1.2.2
[25729] Fix | Delete
*/
[25730] Fix | Delete
$ext = pathinfo( strtok( $icon, '?' ), PATHINFO_EXTENSION );
[25731] Fix | Delete
[25732] Fix | Delete
$local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.{$ext}" );
[25733] Fix | Delete
[25734] Fix | Delete
// Try to download the icon.
[25735] Fix | Delete
$icon_found = fs_download_image( $icon, $local_path );
[25736] Fix | Delete
}
[25737] Fix | Delete
}
[25738] Fix | Delete
[25739] Fix | Delete
if ( ! $icon_found ) {
[25740] Fix | Delete
// No icons found, fallback to default icon.
[25741] Fix | Delete
if ( $have_write_permissions ) {
[25742] Fix | Delete
// If have write permissions, copy default icon.
[25743] Fix | Delete
copy( fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" ), $local_path );
[25744] Fix | Delete
} else {
[25745] Fix | Delete
// If doesn't have write permissions, use default icon path.
[25746] Fix | Delete
$local_path = fs_normalize_path( $img_dir . "/{$this->_module_type}-icon.png" );
[25747] Fix | Delete
}
[25748] Fix | Delete
}
[25749] Fix | Delete
[25750] Fix | Delete
$icons = array( $local_path );
[25751] Fix | Delete
}
[25752] Fix | Delete
}
[25753] Fix | Delete
}
[25754] Fix | Delete
[25755] Fix | Delete
$icon_dir = dirname( $icons[0] );
[25756] Fix | Delete
[25757] Fix | Delete
return fs_img_url( substr( $icons[0], strlen( $icon_dir ) ), $icon_dir );
[25758] Fix | Delete
}
[25759] Fix | Delete
[25760] Fix | Delete
/**
[25761] Fix | Delete
* Fetch module's extended info.
[25762] Fix | Delete
*
[25763] Fix | Delete
* @author Vova Feldman (@svovaf)
[25764] Fix | Delete
* @since 2.0.0
[25765] Fix | Delete
*
[25766] Fix | Delete
* @return object|mixed
[25767] Fix | Delete
*/
[25768] Fix | Delete
private function fetch_module_info() {
[25769] Fix | Delete
return $this->get_api_plugin_scope()->get( 'info.json', false, WP_FS__TIME_WEEK_IN_SEC );
[25770] Fix | Delete
}
[25771] Fix | Delete
[25772] Fix | Delete
/**
[25773] Fix | Delete
* Fetch module's remote icon URL.
[25774] Fix | Delete
*
[25775] Fix | Delete
* @author Vova Feldman (@svovaf)
[25776] Fix | Delete
* @since 2.0.0
[25777] Fix | Delete
*
[25778] Fix | Delete
* @return string
[25779] Fix | Delete
*/
[25780] Fix | Delete
function fetch_remote_icon_url() {
[25781] Fix | Delete
$info = $this->fetch_module_info();
[25782] Fix | Delete
[25783] Fix | Delete
return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ?
[25784] Fix | Delete
$info->icon :
[25785] Fix | Delete
'';
[25786] Fix | Delete
}
[25787] Fix | Delete
[25788] Fix | Delete
#--------------------------------------------------------------------------------
[25789] Fix | Delete
#region GDPR
[25790] Fix | Delete
#--------------------------------------------------------------------------------
[25791] Fix | Delete
[25792] Fix | Delete
/**
[25793] Fix | Delete
* @author Leo Fajardo (@leorw)
[25794] Fix | Delete
* @since 2.1.0
[25795] Fix | Delete
*
[25796] Fix | Delete
* @param array $user_plugins
[25797] Fix | Delete
*
[25798] Fix | Delete
* @return string
[25799] Fix | Delete
*/
[25800] Fix | Delete
private function get_gdpr_admin_notice_string( $user_plugins ) {
[25801] Fix | Delete
$this->_logger->entrance();
[25802] Fix | Delete
[25803] Fix | Delete
$addons = self::get_all_addons();
[25804] Fix | Delete
[25805] Fix | Delete
foreach ( $user_plugins as $user_plugin ) {
[25806] Fix | Delete
$has_addons = isset( $addons[ $user_plugin->id ] );
[25807] Fix | Delete
[25808] Fix | Delete
if ( WP_FS__MODULE_TYPE_PLUGIN === $user_plugin->type && ! $has_addons ) {
[25809] Fix | Delete
if ( $this->_module_id == $user_plugin->id ) {
[25810] Fix | Delete
$addons = $this->get_addons();
[25811] Fix | Delete
$has_addons = ( ! empty( $addons ) );
[25812] Fix | Delete
} else {
[25813] Fix | Delete
$plugin_api = FS_Api::instance(
[25814] Fix | Delete
$user_plugin->id,
[25815] Fix | Delete
'plugin',
[25816] Fix | Delete
$user_plugin->id,
[25817] Fix | Delete
$user_plugin->public_key,
[25818] Fix | Delete
! $user_plugin->is_live,
[25819] Fix | Delete
false,
[25820] Fix | Delete
$this->get_sdk_version()
[25821] Fix | Delete
);
[25822] Fix | Delete
[25823] Fix | Delete
$addons_result = $plugin_api->get( '/addons.json?enriched=true', true );
[25824] Fix | Delete
[25825] Fix | Delete
if ( $this->is_api_result_object( $addons_result, 'plugins' ) &&
[25826] Fix | Delete
is_array( $addons_result->plugins ) &&
[25827] Fix | Delete
! empty( $addons_result->plugins )
[25828] Fix | Delete
) {
[25829] Fix | Delete
$has_addons = true;
[25830] Fix | Delete
}
[25831] Fix | Delete
}
[25832] Fix | Delete
}
[25833] Fix | Delete
[25834] Fix | Delete
$user_plugin->has_addons = $has_addons;
[25835] Fix | Delete
}
[25836] Fix | Delete
[25837] Fix | Delete
$is_single_parent_product = ( 1 === count( $user_plugins ) );
[25838] Fix | Delete
[25839] Fix | Delete
$multiple_products_text = '';
[25840] Fix | Delete
[25841] Fix | Delete
if ( $is_single_parent_product ) {
[25842] Fix | Delete
$single_parent_product = reset( $user_plugins );
[25843] Fix | Delete
[25844] Fix | Delete
$thank_you = sprintf(
[25845] Fix | Delete
"<span data-plugin-id='%d'>%s</span>",
[25846] Fix | Delete
$single_parent_product->id,
[25847] Fix | Delete
sprintf(
[25848] Fix | Delete
$single_parent_product->has_addons ?
[25849] Fix | Delete
$this->get_text_inline( 'Thank you so much for using %s and its add-ons!', 'thank-you-for-using-product-and-its-addons' ) :
[25850] Fix | Delete
$this->get_text_inline( 'Thank you so much for using %s!', 'thank-you-for-using-product' ),
[25851] Fix | Delete
sprintf('<b><i>%s</i></b>', $single_parent_product->title)
[25852] Fix | Delete
)
[25853] Fix | Delete
);
[25854] Fix | Delete
[25855] Fix | Delete
$already_opted_in = sprintf(
[25856] Fix | Delete
$this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving the %s.", 'already-opted-in-to-product-usage-tracking' ),
[25857] Fix | Delete
( WP_FS__MODULE_TYPE_THEME === $single_parent_product->type ) ? WP_FS__MODULE_TYPE_THEME : WP_FS__MODULE_TYPE_PLUGIN
[25858] Fix | Delete
);
[25859] Fix | Delete
} else {
[25860] Fix | Delete
$thank_you = $this->get_text_inline( 'Thank you so much for using our products!', 'thank-you-for-using-products' );
[25861] Fix | Delete
$already_opted_in = $this->get_text_inline( "You've already opted-in to our usage-tracking, which helps us keep improving them.", 'already-opted-in-to-products-usage-tracking' );
[25862] Fix | Delete
[25863] Fix | Delete
$products_and_add_ons = '';
[25864] Fix | Delete
foreach ( $user_plugins as $user_plugin ) {
[25865] Fix | Delete
if ( ! empty( $products_and_add_ons ) ) {
[25866] Fix | Delete
$products_and_add_ons .= ', ';
[25867] Fix | Delete
}
[25868] Fix | Delete
[25869] Fix | Delete
if ( ! $user_plugin->has_addons ) {
[25870] Fix | Delete
$products_and_add_ons .= sprintf(
[25871] Fix | Delete
"<span data-plugin-id='%d'>%s</span>",
[25872] Fix | Delete
$user_plugin->id,
[25873] Fix | Delete
$user_plugin->title
[25874] Fix | Delete
);
[25875] Fix | Delete
} else {
[25876] Fix | Delete
$products_and_add_ons .= sprintf(
[25877] Fix | Delete
"<span data-plugin-id='%d'>%s</span>",
[25878] Fix | Delete
$user_plugin->id,
[25879] Fix | Delete
sprintf(
[25880] Fix | Delete
$this->get_text_inline( '%s and its add-ons', 'product-and-its-addons' ),
[25881] Fix | Delete
$user_plugin->title
[25882] Fix | Delete
)
[25883] Fix | Delete
);
[25884] Fix | Delete
}
[25885] Fix | Delete
}
[25886] Fix | Delete
[25887] Fix | Delete
$multiple_products_text = sprintf(
[25888] Fix | Delete
"<small class='products'><strong>%s:</strong> %s</small>",
[25889] Fix | Delete
$this->get_text_inline( 'Products', 'products' ),
[25890] Fix | Delete
$products_and_add_ons
[25891] Fix | Delete
);
[25892] Fix | Delete
}
[25893] Fix | Delete
[25894] Fix | Delete
$actions = sprintf(
[25895] Fix | Delete
'<ul><li>%s<span class="action-description"> - %s</span></li><li>%s<span class="action-description"> - %s</span></li></ul>',
[25896] Fix | Delete
sprintf('<button class="button button-primary allow-marketing">%s</button>', $this->get_text_inline( 'Yes', 'yes' ) ),
[25897] Fix | Delete
$this->get_text_inline( 'send me security & feature updates, educational content and offers.', 'send-updates' ),
[25898] Fix | Delete
sprintf('<button class="button button-secondary">%s</button>', $this->get_text_inline( 'No', 'no' ) ),
[25899] Fix | Delete
sprintf(
[25900] Fix | Delete
$this->get_text_inline( 'do %sNOT%s send me security & feature updates, educational content and offers.', 'do-not-send-updates' ),
[25901] Fix | Delete
'<span class="underlined">',
[25902] Fix | Delete
'</span>'
[25903] Fix | Delete
)
[25904] Fix | Delete
);
[25905] Fix | Delete
[25906] Fix | Delete
return sprintf(
[25907] Fix | Delete
'%s %s %s',
[25908] Fix | Delete
$thank_you,
[25909] Fix | Delete
$already_opted_in,
[25910] Fix | Delete
sprintf( $this->get_text_inline( 'Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)', 'due-to-gdpr-compliance-requirements' ), '<a href="https://ec.europa.eu/info/law/law-topic/data-protection_en/" target="_blank" rel="noopener noreferrer">', '</a>' ) .
[25911] Fix | Delete
'<br><br>' .
[25912] Fix | Delete
'<b>' . $this->get_text_inline( "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:", 'contact-for-updates' ) . '</b>' .
[25913] Fix | Delete
$actions .
[25914] Fix | Delete
( $is_single_parent_product ? '' : $multiple_products_text )
[25915] Fix | Delete
);
[25916] Fix | Delete
}
[25917] Fix | Delete
[25918] Fix | Delete
/**
[25919] Fix | Delete
* This method is called for opted-in users to fetch the is_marketing_allowed flag of the user for all the
[25920] Fix | Delete
* plugins and themes they've opted in to.
[25921] Fix | Delete
*
[25922] Fix | Delete
* @author Leo Fajardo (@leorw)
[25923] Fix | Delete
* @since 2.1.0
[25924] Fix | Delete
*
[25925] Fix | Delete
* @param string $user_email
[25926] Fix | Delete
* @param string $license_key
[25927] Fix | Delete
* @param array $plugin_ids
[25928] Fix | Delete
* @param string|null $license_key
[25929] Fix | Delete
*
[25930] Fix | Delete
* @return array|false
[25931] Fix | Delete
*/
[25932] Fix | Delete
private function fetch_user_marketing_flag_status_by_plugins( $user_email, $license_key, $plugin_ids ) {
[25933] Fix | Delete
$request = array(
[25934] Fix | Delete
'method' => 'POST',
[25935] Fix | Delete
'body' => array(),
[25936] Fix | Delete
'timeout' => WP_FS__DEBUG_SDK ? 60 : 30,
[25937] Fix | Delete
);
[25938] Fix | Delete
[25939] Fix | Delete
if ( is_string( $user_email ) ) {
[25940] Fix | Delete
$request['body']['email'] = $user_email;
[25941] Fix | Delete
} else {
[25942] Fix | Delete
$request['body']['license_key'] = $license_key;
[25943] Fix | Delete
}
[25944] Fix | Delete
[25945] Fix | Delete
$result = array();
[25946] Fix | Delete
[25947] Fix | Delete
$url = WP_FS__ADDRESS . '/action/service/user_plugin/';
[25948] Fix | Delete
$total_plugin_ids = count( $plugin_ids );
[25949] Fix | Delete
[25950] Fix | Delete
$plugin_ids_count_per_request = 10;
[25951] Fix | Delete
for ( $i = 1; $i <= $total_plugin_ids; $i += $plugin_ids_count_per_request ) {
[25952] Fix | Delete
$plugin_ids_set = array_slice( $plugin_ids, $i - 1, $plugin_ids_count_per_request );
[25953] Fix | Delete
[25954] Fix | Delete
$request['body']['plugin_ids'] = $plugin_ids_set;
[25955] Fix | Delete
[25956] Fix | Delete
$response = self::safe_remote_post(
[25957] Fix | Delete
$url,
[25958] Fix | Delete
$request,
[25959] Fix | Delete
WP_FS__TIME_24_HOURS_IN_SEC,
[25960] Fix | Delete
WP_FS__TIME_12_HOURS_IN_SEC
[25961] Fix | Delete
);
[25962] Fix | Delete
[25963] Fix | Delete
if ( ! is_wp_error( $response ) ) {
[25964] Fix | Delete
$decoded = is_string( $response['body'] ) ?
[25965] Fix | Delete
json_decode( $response['body'] ) :
[25966] Fix | Delete
null;
[25967] Fix | Delete
[25968] Fix | Delete
if (
[25969] Fix | Delete
!is_object($decoded) ||
[25970] Fix | Delete
!isset($decoded->success) ||
[25971] Fix | Delete
true !== $decoded->success ||
[25972] Fix | Delete
!isset( $decoded->data ) ||
[25973] Fix | Delete
!is_array( $decoded->data )
[25974] Fix | Delete
) {
[25975] Fix | Delete
return false;
[25976] Fix | Delete
}
[25977] Fix | Delete
[25978] Fix | Delete
$result = array_merge( $result, $decoded->data );
[25979] Fix | Delete
}
[25980] Fix | Delete
}
[25981] Fix | Delete
[25982] Fix | Delete
return $result;
[25983] Fix | Delete
}
[25984] Fix | Delete
[25985] Fix | Delete
/**
[25986] Fix | Delete
* @author Leo Fajardo (@leorw)
[25987] Fix | Delete
* @since 2.1.0
[25988] Fix | Delete
*/
[25989] Fix | Delete
function _maybe_show_gdpr_admin_notice() {
[25990] Fix | Delete
if ( ! $this->is_user_in_admin() ) {
[25991] Fix | Delete
return;
[25992] Fix | Delete
}
[25993] Fix | Delete
[25994] Fix | Delete
if ( ! $this->should_handle_gdpr_admin_notice() ) {
[25995] Fix | Delete
return;
[25996] Fix | Delete
}
[25997] Fix | Delete
[25998] Fix | Delete
if ( ! $this->is_user_admin() ) {
[25999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function