v1.1.1
This commit is contained in:
parent
5221310caa
commit
7ae471e27f
1 changed files with 1876 additions and 143 deletions
|
|
@ -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'.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue