: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! class_exists( "PPW_Settings" ) ) {
* Render UI settings page
public function render_ui() {
$_get = wp_unslash( $_GET ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We no need to handle nonce verification for render UI.
$plugin_info = apply_filters( PPW_Constants::HOOK_PLUGIN_INFO, array(
'name' => __('Password Protect WordPress - PPWP'),
'version' => PPW_VERSION,
<div id="icon-themes" class="icon32"></div>
<?php esc_html_e( $plugin_info['name'], PPW_Constants::DOMAIN ); ?>
<span class="ppwp_version"><?php esc_html_e( $plugin_info['version'] ) ?></span>
$default_tab = apply_filters( PPW_Constants::HOOK_DEFAULT_TAB, 'general' );
$activate_tab = isset( $_get['tab'] ) ? $_get['tab'] : $default_tab;
$this->render_tabs( $activate_tab );
$this->render_content( $activate_tab );
* Render tab for settings page
* @param string $active_tab Active tab.
private function render_tabs( $active_tab ) {
PPW_Constants::HOOK_ADD_NEW_TAB,
'tab_name' => 'Advanced',
'tab_name' => 'Sitewide',
'tab_name' => 'Shortcodes',
'tab' => 'master_passwords',
'tab_name' => 'Master Passwords',
'tab' => 'troubleshooting',
'tab_name' => 'Troubleshooting',
<h2 class="ppwp_wrap_tab_title nav-tab-wrapper">
if ( ! is_array( $tabs ) ) {
foreach ( $tabs as $tab ) {
if ( ! is_array( $tab ) ) {
if ( empty( $tab['tab'] ) || empty( $tab['tab_name'] ) ) {
<a href="?page=<?php echo esc_html( PPW_Constants::MENU_NAME ); ?>&tab=<?php echo esc_attr( $tab['tab'] ); ?>"
class="nav-tab <?php echo $active_tab === $tab['tab'] ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( $tab['tab_name'], PPW_Constants::DOMAIN ); ?></a>
* Render content for settings page
* @param string $active_tab Active tab.
private function render_content( $active_tab ) {
$tabs = apply_filters( PPW_Constants::HOOK_CUSTOM_TAB, array( 'general', 'misc', 'entire_site', 'shortcodes', 'master_passwords', 'troubleshooting' ) );
foreach ( $tabs as $tab ) {
if ( $active_tab === $tab ) {
do_action( PPW_Constants::HOOK_RENDER_CONTENT_FOR_TAB . $tab );