: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @copyright Copyright (c) 2015, Freemius, Inc.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
if ( ! defined( 'ABSPATH' ) ) {
class FS_Plugin extends FS_Scope_Entity {
public $parent_plugin_id;
* @author Leo Fajardo (@leorw)
* @var string 'plugin' or 'theme'
* @author Leo Fajardo (@leorw)
* @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
public $affiliate_moderation;
* @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
public $is_wp_org_compliant = true;
* @author Leo Fajardo (@leorw)
public $premium_releases_count;
#region Install Specific Properties
* @author Leo Fajardo (@leorw)
public $bundle_public_key;
public $opt_in_moderation;
const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
#endregion Install Specific Properties
* @param stdClass|bool $plugin
function __construct( $plugin = false ) {
parent::__construct( $plugin );
$this->is_premium = false;
if ( empty( $this->premium_slug ) && ! empty( $plugin->slug ) ) {
$this->premium_slug = "{$this->slug}-premium";
if ( empty( $this->premium_suffix ) ) {
$this->premium_suffix = '(Premium)';
if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
$this->info = new FS_Plugin_Info( $plugin->info );
* Check if plugin is an add-on (has parent).
* @author Vova Feldman (@svovaf)
return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
* @author Leo Fajardo (@leorw)
function has_affiliate_program() {
return ( ! empty( $this->affiliate_moderation ) );
static function get_type() {