: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Check if a usesr can be subscribed to our newsletter
* check if is already subscribed or email is invalid
* @return bool true if user can subscribe
public function user_can_subscribe() {
// respect previous settings.
$options = $this->options();
if ( isset( $options['is_subscribed'] ) ) {
$current_user = wp_get_current_user();
if ( empty( $current_user->ID ) || empty( $current_user->user_email ) ) {
$subscribed = get_user_meta( $current_user->ID, 'advanced-ads-subscribed', true );
// secureserver.net email address belong to GoDaddy (?) and have very, very low open rates. Seems like only temporary setup.
return ( ! $subscribed && is_email( $current_user->user_email ) && false === strpos( $current_user->user_email, 'secureserver.net' ) )
* Update information that the current user is subscribed
private function mark_as_subscribed() {
$user_id = get_current_user_id();
if ( ! $this->is_subscribed() ) {
update_user_meta( $user_id, 'advanced-ads-subscribed', true );
* Add AdSense tutorial notice
* @param Advanced_Ads_Ad $ad ad object.
* @param array $types ad types.
public function adsense_tutorial( $ad, $types = [] ) {
$options = $this->options();
if ( 'adsense' !== $ad->type || isset( $options['closed'][ $_notice ] ) ) {
include ADVADS_ABSPATH . '/admin/includes/notices.php';
if ( ! isset( $advanced_ads_admin_notices[ $_notice ] ) ) {
$notice = $advanced_ads_admin_notices[ $_notice ];
include ADVADS_ABSPATH . '/admin/views/notices/inline.php';
* Create the content of a welcome panel like WordPress core does
public function get_welcome_panel() {
include ADVADS_ABSPATH . '/admin/views/notices/welcome-panel.php';