: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Abstract class for an integration module: class Abstract_Integration
* @package Smush\Core\Modules\Integrations
namespace Smush\Core\Integrations;
if ( ! defined( 'WPINC' ) ) {
* Class Abstract_Integration
abstract class Abstract_Integration {
* Module class - free module by default, can be pro.
* @var string $class Accepts: 'free', 'pro'.
protected $class = 'free';
protected $enabled = false;
* Settings class instance for easier access.
* Abstract_Integration constructor.
public function __construct() {
$this->settings = Settings::get_instance();
// Filters the setting variable to add module setting title and description.
add_filter( 'wp_smush_settings', array( $this, 'register' ) );
add_filter( 'wp_smush_integration_status_' . $this->module, array( $this, 'setting_status' ) );
// Show submit button if one of the integrations available.
add_filter( 'wp_smush_integration_show_submit', array( $this, 'enable_submit_button' ) );
* Update setting status - disable module functionality if not enabled.
public function setting_status() {
* Whether to enable the submit button or not.
* @param bool $enabled Current status.
public function enable_submit_button( $enabled ) {
return $enabled || $this->enabled;