checker->request( 'status', $args ); $status = $response['status'] ?? 'invalid'; } if ( empty( $response ) ) { add_settings_error( '', 'mb-error', __( 'Something wrong with the connection to metabox.io. Please try again later.', 'meta-box' ) ); } elseif ( 'active' === $status ) { add_settings_error( '', 'mb-success', __( 'Your license is activated.', 'meta-box' ), 'updated' ); } elseif ( 'expired' === $status ) { // Translators: %s - URL to the My Account page. $message = __( 'License expired. Please renew on the My Account page on metabox.io website.', 'meta-box' ); $message = wp_kses_post( sprintf( $message, 'https://elu.to/mua' ) ); add_settings_error( '', 'mb-expired', $message ); } else { // Translators: %1$s - URL to the My Account page, %2$s - URL to the pricing page. $message = __( 'Invalid license. Please check again or get a new license here.', 'meta-box' ); $message = wp_kses_post( sprintf( $message, 'https://elu.to/mua', 'https://mup' ) ); add_settings_error( '', 'mb-invalid', $message ); } $option['status'] = $status; $admin_notices_hook = $this->option->is_network_activated() ? 'network_admin_notices' : 'admin_notices'; add_action( $admin_notices_hook, 'settings_errors' ); $this->option->update( $option ); } }