esc_html__( 'Yoast SEO', 'wp-security-audit-log' ), 'yoast-seo-metabox' => esc_html__( 'Yoast SEO Meta Box', 'wp-security-audit-log' ), 'yoast-seo-search-appearance' => esc_html__( 'Yoast SEO Search Appearance', 'wp-security-audit-log' ), 'yoast-seo-redirects' => esc_html__( 'Yoast SEO Redirects', 'wp-security-audit-log' ), ); // combine the two arrays. $objects = array_merge( $objects, $new_objects ); return $objects; } /** * Add specific events so we can use them for category titles. * * @param array $sub_category_events - Current event list. * @return array $sub_category_events - Appended list. */ function wsal_yoast_seo_extension_togglealerts_sub_category_events( $sub_category_events ) { $new_events = array( 8813, 8815, 8838 ); $sub_category_events = array_merge( $sub_category_events, $new_events ); return $sub_category_events; } /** * Add sub cateogry titles to ToggleView page in WSAL. * * @param string $subcat_title - Original title. * @param int $alert_id - Alert ID. * @return string $subcat_title - New title. */ function wsal_yoast_seo_extension_togglealerts_sub_category_titles( $subcat_title, $alert_id ) { if ( 8815 === $alert_id ) { $subcat_title = esc_html_e( 'Features:', 'wp-security-audit-log' ); } elseif ( 8813 === $alert_id ) { $subcat_title = esc_html_e( 'Search Appearance', 'wp-security-audit-log' ); } elseif ( 8838 === $alert_id ) { $subcat_title = esc_html_e( 'Multisite network', 'wp-security-audit-log' ); } return $subcat_title; } /** * If a user is running an older version of WSAL, they will see a "duplicate event" error. * This function checks and runs a filter to replace that notice. Its done via JS as we cant * currently give this notice a neat ID/class. */ function wsal_yoast_seo_extension_replace_duplicate_event_notice() { $wsal_version = get_site_option( 'wsal_version' ); if ( version_compare( $wsal_version, '4.1.3.2', '<=' ) ) { add_action( 'admin_footer', 'wsal_yoast_seo_extension_replacement_duplicate_event_notice' ); } } /** * Add obsolete events to the togglealerts view. * * @param array $obsolete_events - Current events. * @return array $obsolete_events - Appended events. */ function wsal_yoast_seo_extension_togglealerts_obsolete_events( $obsolete_events ) { $new_events = array( 8810, 8811 ); $obsolete_events = array_merge( $obsolete_events, $new_events ); return $obsolete_events; } /** * Replacement "duplicate event" notice text. */ function wsal_yoast_seo_extension_replacement_duplicate_event_notice() { $replacement_text = esc_html__( 'You are running an old version of WP Activity Log. Please update the plugin to run it alongside this extension: Yoast SEO', 'wp-security-audit-log' ); ?> __DIR__ . '/wp-security-audit-log/sensors/class-yoast-seo-sensor.php', ) ); } ); add_action( 'wsal_custom_alerts_register', /** * Adds sensors classes to the Class Helper * * @return void * * @since latest */ function () { require_once __DIR__ . '/wp-security-audit-log/class-yoast-custom-alerts.php'; Classes_Helper::add_to_class_map( array( 'WSAL\\Custom_Alerts\\Yoast_Custom_Alerts' => __DIR__ . '/wp-security-audit-log/class-yoast-custom-alerts.php', ) ); } );