Merged in feature/314-dev-dev01 (pull request #24)
auto-patch 314-dev-dev01-2024-01-25T04_09_02 * auto-patch 314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
@@ -85,11 +85,11 @@ class WPSEO_Tracking_Addon_Data implements WPSEO_Collection {
|
||||
* @return array
|
||||
*/
|
||||
public function get_addon_settings( array $addon_settings, $source_name, $slug, $option_include_list ) {
|
||||
$source_options = \get_option( $source_name, [] );
|
||||
if ( ! \is_array( $source_options ) || empty( $source_options ) ) {
|
||||
$source_options = get_option( $source_name, [] );
|
||||
if ( ! is_array( $source_options ) || empty( $source_options ) ) {
|
||||
return $addon_settings;
|
||||
}
|
||||
$addon_settings[ $slug ] = \array_intersect_key( $source_options, \array_flip( $option_include_list ) );
|
||||
$addon_settings[ $slug ] = array_intersect_key( $source_options, array_flip( $option_include_list ) );
|
||||
|
||||
return $addon_settings;
|
||||
}
|
||||
@@ -107,13 +107,13 @@ class WPSEO_Tracking_Addon_Data implements WPSEO_Collection {
|
||||
* @return array
|
||||
*/
|
||||
public function get_local_addon_settings( array $addon_settings, $source_name, $slug, $option_include_list ) {
|
||||
$source_options = \get_option( $source_name, [] );
|
||||
if ( ! \is_array( $source_options ) || empty( $source_options ) ) {
|
||||
$source_options = get_option( $source_name, [] );
|
||||
if ( ! is_array( $source_options ) || empty( $source_options ) ) {
|
||||
return $addon_settings;
|
||||
}
|
||||
$addon_settings[ $slug ] = \array_intersect_key( $source_options, \array_flip( $option_include_list ) );
|
||||
$addon_settings[ $slug ] = array_intersect_key( $source_options, array_flip( $option_include_list ) );
|
||||
|
||||
if ( \array_key_exists( 'use_multiple_locations', $source_options ) && \array_key_exists( 'business_type', $addon_settings[ $slug ] ) && $source_options['use_multiple_locations'] === 'on' && $source_options['multiple_locations_shared_business_info'] === 'off' ) {
|
||||
if ( array_key_exists( 'use_multiple_locations', $source_options ) && array_key_exists( 'business_type', $addon_settings[ $slug ] ) && $source_options['use_multiple_locations'] === 'on' && $source_options['multiple_locations_shared_business_info'] === 'off' ) {
|
||||
$addon_settings[ $slug ]['business_type'] = 'multiple_locations';
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
|
||||
public function set_auto_update_plugin_list() {
|
||||
|
||||
$auto_update_plugins = [];
|
||||
$auto_update_plugin_files = \get_option( 'auto_update_plugins' );
|
||||
$auto_update_plugin_files = get_option( 'auto_update_plugins' );
|
||||
if ( $auto_update_plugin_files ) {
|
||||
foreach ( $auto_update_plugin_files as $auto_update_plugin ) {
|
||||
$data = get_plugin_data( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $auto_update_plugin );
|
||||
@@ -84,7 +84,7 @@ class WPSEO_Tracking_Plugin_Data implements WPSEO_Collection {
|
||||
return [
|
||||
'name' => $plugin['Name'],
|
||||
'version' => $plugin['Version'],
|
||||
'auto_updating' => \array_key_exists( $plugin['Name'], $this->auto_update_plugin_list ),
|
||||
'auto_updating' => array_key_exists( $plugin['Name'], $this->auto_update_plugin_list ),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
|
||||
/**
|
||||
* Filter: 'wpseo_tracking_settings_include_list' - Allow filtering the settings included in tracking.
|
||||
*
|
||||
* @api string $include_list the list with included setting names.
|
||||
* @param string $include_list The list with included setting names.
|
||||
*/
|
||||
$this->include_list = apply_filters( 'wpseo_tracking_settings_include_list', $this->include_list );
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
||||
|
||||
/**
|
||||
* Registers all hooks to WordPress.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register_hooks() {
|
||||
if ( ! $this->tracking_enabled() ) {
|
||||
@@ -110,6 +112,8 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
||||
*
|
||||
* @param bool $force Whether to send the tracking data ignoring the two
|
||||
* weeks time threshold. Default false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function send( $force = false ) {
|
||||
if ( ! $this->should_send_tracking( $force ) ) {
|
||||
@@ -216,7 +220,7 @@ class WPSEO_Tracking implements WPSEO_WordPress_Integration {
|
||||
/**
|
||||
* Filter: 'wpseo_enable_tracking' - Enables the data tracking of Yoast SEO Premium and add-ons.
|
||||
*
|
||||
* @api string $is_enabled The enabled state. Default is false.
|
||||
* @param string $is_enabled The enabled state. Default is false.
|
||||
*/
|
||||
$tracking = apply_filters( 'wpseo_enable_tracking', false );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user