'activity-log-wp-seo', 'custom_alert_path' => trailingslashit( dirname( __FILE__ ) ) . 'wp-security-audit-log', 'custom_sensor_path' => trailingslashit( trailingslashit( dirname( __FILE__ ) ) . 'wp-security-audit-log' . DIRECTORY_SEPARATOR . 'custom-sensors' ), ); $wsal_extension = new WPWhiteSecurity\ActivityLog\Extensions\Common\Core( $core_settings ); /** * Adds new custom event objects for our plugin * * @method wsal_yoast_seo_extension_add_custom_event_objects * @since 1.0.0 * @param array $objects An array of default objects. * @return array */ function wsal_yoast_seo_extension_add_custom_event_objects( $objects ) { $new_objects = array( 'yoast-seo' => __( 'Yoast SEO', 'wp-security-audit-log' ), 'yoast-seo-metabox' => __( 'Yoast SEO Meta Box', '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. */ function wsal_yoast_seo_extension_togglealerts_sub_category_events( $sub_category_events ) { $new_events = array( 8813, 8815 ); $sub_category_events = array_merge( $sub_category_events, $new_events ); return $sub_category_events; } /** * Add sub cateogry titles to ToggleView page in WSAL. */ function wsal_yoast_seo_extension_togglealerts_sub_category_titles( $alert_id ) { $title = ''; if ( 8815 === $alert_id ) { $title = esc_html_e( 'Features:', 'wp-security-audit-log' ); } if ( 8813 === $alert_id ) { $title = esc_html_e( 'Search Appearance', 'wp-security-audit-log' ); } return $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' ); } } /** * Replacement "duplicate event" notice text. */ function wsal_yoast_seo_extension_replacement_duplicate_event_notice() { $replacement_text = __( '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' ); ?>