This commit is contained in:
Javier Casares 2026-08-18 19:06:22 +00:00
commit 7ae471e27f

View file

@ -46,6 +46,7 @@ if ( ! class_exists( 'Robotstxt_Telemetry_Network' ) ) {
'robotstxt_telemetry_wp_themes_check' => 'safe',
'robotstxt_telemetry_wp_plugins_check' => 'safe',
'robotstxt_telemetry_hidden_plugins' => array(),
'robotstxt_telemetry_plugin_modes' => array(),
'robotstxt_telemetry_retention_period' => '12hours',
'robotstxt_telemetry_delete_on_uninstall' => false,
);
@ -204,6 +205,29 @@ if ( ! class_exists( 'Robotstxt_Telemetry_Network' ) ) {
return array_values( array_unique( $hidden ) );
}
/**
* Get the per-plugin safe-mode map (slug => safe|original).
*
* @return array
*/
public static function get_plugin_modes() {
$modes = self::get_setting( 'robotstxt_telemetry_plugin_modes', array() );
return is_array( $modes ) ? $modes : array();
}
/**
* Get the mode of a single plugin (Safe by default).
*
* @param string $slug Plugin slug.
* @return string
*/
public static function get_plugin_mode( $slug ) {
$modes = self::get_plugin_modes();
return isset( $modes[ $slug ] ) && 'original' === $modes[ $slug ] ? 'original' : 'safe';
}
/**
* The User-Agent URL mode: 'url', 'hash' (default), or 'none'.
*