"eyJhbGwiOiIxNTAiLCJwb3J0cmFpdCI6IjEyMCIsImxhbmRzY2FwZSI6IjE0MCJ9","mm_sub_border":"0","mm_elem_border":"0","mm_elem_border_a":"0","mm_elem_padd":"eyJwb3J0cmFpdCI6IjAiLCJhbGwiOiIwIn0=","mm_border_size":"0","sub_shadow_shadow_size":"16","sub_shadow_shadow_offset_horizontal":"0","sub_shadow_shadow_offset_vertical":"2","sub_shadow_shadow_color":"rgba(0,0,0,0.12)","mm_shadow_shadow_size":"20","mm_shadow_shadow_offset_vertical":"4","mm_shadow_shadow_color":"rgba(0,0,0,0.12)","mm_elem_color":"#000000","mm_elem_color_a":"#f43f3f","mm_elem_order":"id","mm_elem_space":"eyJhbGwiOiIxMCIsInBvcnRyYWl0IjoiNSIsImxhbmRzY2FwZSI6IjgifQ==","mm_elem_bg":"rgba(255,255,255,0)","mm_elem_bg_a":"rgba(255,255,255,0)","mm_elem_border_color_a":"#000000","mm_sub_padd":"eyJhbGwiOiIyMHB4IiwicG9ydHJhaXQiOiIxNXB4In0=","f_mm_sub_font_family":"438","f_mm_sub_font_weight":"600","f_mm_sub_font_size":"eyJhbGwiOiIxNCIsInBvcnRyYWl0IjoiMTIiLCJsYW5kc2NhcGUiOiIxMyJ9","show_cat":"none","art_title":"0","f_title_font_family":"373","f_title_font_size":"eyJhbGwiOiIxNCIsInBvcnRyYWl0IjoiMTIiLCJsYW5kc2NhcGUiOiIxMyJ9","f_title_font_line_height":"1.4","f_title_font_weight":"600","f_title_font_transform":"","title_txt":"#000000","title_txt_hover":"#f43f3f","image_height":"60","all_modules_space":"eyJhbGwiOiIzMCIsInBvcnRyYWl0IjoiMjAifQ==","pag_text":"#000000","pag_h_text":"#f43f3f","pag_bg":"rgba(255,255,255,0)","pag_h_bg":"rgba(255,255,255,0)","meta_padding":"eyJhbGwiOiIxNXB4IDAgMCAwIiwibGFuZHNjYXBlIjoiMTJweCAwIDAgMCIsInBvcnRyYWl0IjoiMTBweCAwIDAgMCJ9","art_excerpt":"0","modules_gap":"eyJhbGwiOiIyMCIsImxhbmRzY2FwZSI6IjE1IiwicG9ydHJhaXQiOiIxMCJ9","mm_padd":"eyJhbGwiOiIyMCIsInBvcnRyYWl0IjoiMTUifQ==","pag_space":"eyJwb3J0cmFpdCI6IjE1In0=","text_color":"#000000","tds_menu_active1-line_height":"0","tds_menu_active1-line_alignment":"50","tds_menu_active1-text_color_h":"#f43f3f","inline":"yes","show_subcat":"yes","mm_subcats_bg":"#ffffff","mm_subcats_posts_limit":"8","mm_child_cats":"10","mm_ajax_preloading":"preload","mm_hide_all_item":"yes","pag_icons_size":"8","block_type":"tdb_header_mega_menu","show_mega":"","mob_load":"","separator":"","width":"","float_right":"","align_horiz":"content-horiz-left","sep_tdicon":"","sep_icon_size":"","sep_icon_space":"","sep_icon_align":"-1","more_txt":"","more_icon_align":"0","sub_width":"","sub_first_left":"","sub_rest_top":"","sub_padd":"","sub_align_horiz":"content-horiz-left","sub_elem_inline":"","sub_elem_space":"","sub_elem_radius":"0","sub_tdicon":"","sub_icon_size":"","sub_icon_space":"","sub_icon_pos":"","sub_icon_align":"1","mm_content_width":"","mm_height":"","mm_radius":"","mm_offset":"","open_in_new_window":"","mm_sub_inline":"","mm_elem_border_rad":"","mc1_tl":"","mc1_title_tag":"","mc1_el":"","m_padding":"","modules_border_size":"","modules_border_style":"","modules_border_color":"#eaeaea","modules_divider":"","modules_divider_color":"#eaeaea","h_effect":"","image_alignment":"50","image_width":"","image_floated":"no_float","image_radius":"","hide_image":"","video_icon":"","show_vid_t":"block","vid_t_margin":"","vid_t_padding":"","vid_t_color":"","vid_t_bg_color":"","f_vid_time_font_header":"","f_vid_time_font_title":"Video duration text","f_vid_time_font_settings":"","f_vid_time_font_family":"","f_vid_time_font_size":"","f_vid_time_font_line_height":"","f_vid_time_font_style":"","f_vid_time_font_weight":"","f_vid_time_font_transform":"","f_vid_time_font_spacing":"","f_vid_time_":"","show_audio":"block","hide_audio":"","art_audio":"","art_audio_size":"1","meta_info_align":"","meta_info_horiz":"content-horiz-left","meta_width":"","meta_margin":"","meta_info_border_size":"","meta_info_border_style":"","meta_info_border_color":"#eaeaea","modules_category_margin":"","modules_category_padding":"","modules_cat_border":"","modules_category_radius":"0","modules_extra_cat":"","author_photo":"","author_photo_size":"","author_photo_space":"","author_photo_radius":"","show_modified_date":"","time_ago":"","time_ago_add_txt":"ago","time_ago_txt_pos":"","excerpt_col":"1","excerpt_gap":"","excerpt_middle":"","show_review":"inline-block","review_queue_help_scout_script() { // Make sure plugins can filter in their "stuff", before we check whether we're outputting a beacon. $this->filter_settings(); if ( ! $this->is_beacon_page() ) { return; } $this->asset_manager->enqueue_script( 'help-scout-beacon' ); } /** * Outputs a small piece of javascript for the beacon. * * @return void */ public function output_beacon_js() { if ( ! $this->is_beacon_page() ) { return; } \printf( '', ( $this->ask_consent ) ? 'wpseoHelpScoutBeaconConsent' : 'wpseoHelpScoutBeacon', \esc_html( $this->pages_ids[ $this->page ] ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaping done in format_json_encode. WPSEO_Utils::format_json_encode( (array) $this->get_session_data() ) ); } /** * Checks if the current page is a page containing the beacon. * * @return bool */ private function is_beacon_page() { $return = false; if ( ! empty( $this->page ) && $GLOBALS['pagenow'] === 'admin.php' && isset( $this->pages_ids[ $this->page ] ) ) { $return = true; } /** * Filter: 'wpseo_helpscout_show_beacon' - Allows overriding whether we show the HelpScout beacon. * * @param bool $show_beacon Whether we show the beacon or not. */ return \apply_filters( 'wpseo_helpscout_show_beacon', $return ); } /** * Retrieves the identifying data. * * @return string The data to pass as identifying data. */ protected function get_session_data() { // Short-circuit if we can get the needed data from a transient. $transient_data = \get_transient( 'yoast_beacon_session_data' ); if ( \is_array( $transient_data ) ) { return WPSEO_Utils::format_json_encode( $transient_data ); } $current_user = \wp_get_current_user(); // Do not make these strings translatable! They are for our support agents, the user won't see them! $data = \array_merge( [ 'name' => \trim( $current_user->user_firstname . ' ' . $current_user->user_lastname ), 'email' => $current_user->user_email, 'Languages' => $this->get_language_settings(), ], $this->get_server_info(), [ 'WordPress Version' => $this->get_wordpress_version(), 'Active theme' => $this->get_theme_info(), 'Active plugins' => $this->get_active_plugins(), 'Must-use and dropins' => $this->get_mustuse_and_dropins(), 'Indexables status' => $this->get_indexables_status(), ] ); if ( ! empty( $this->products ) ) { $addon_manager = new WPSEO_Addon_Manager(); foreach ( $this->products as $product ) { $subscription = $addon_manager->get_subscription( $product ); if ( ! $subscription ) { continue; } $data[ $subscription->product->name ] = $this->get_product_info( $subscription ); } } // Store the data in a transient for 5 minutes to prevent overhead on every backend pageload. \set_transient( 'yoast_beacon_session_data', $data, ( 5 * \MINUTE_IN_SECONDS ) ); return WPSEO_Utils::format_json_encode( $data ); } /** * Returns basic info about the server software. * * @return array */ private function get_server_info() { $server_tracking_data = new WPSEO_Tracking_Server_Data(); $server_data = $server_tracking_data->get(); $server_data = $server_data['server']; $fields_to_use = [ 'Server IP' => 'ip', 'PHP Version' => 'PhpVersion', 'cURL Version' => 'CurlVersion', ]; $server_data['CurlVersion'] = $server_data['CurlVersion']['version'] . ' (SSL Support ' . $server_data['CurlVersion']['sslSupport'] . ')'; $server_info = []; foreach ( $fields_to_use as $label => $field_to_use ) { if ( isset( $server_data[ $field_to_use ] ) ) { $server_info[ $label ] = \esc_html( $server_data[ $field_to_use ] ); } } // Get the memory limits for the server and, if different, from WordPress as well. $memory_limit = \ini_get( 'memory_limit' ); $server_info['Memory limits'] = 'Server memory limit: ' . $memory_limit; if ( $memory_limit !== \WP_MEMORY_LIMIT ) { $server_info['Memory limits'] .= ', WP_MEMORY_LIMIT: ' . \WP_MEMORY_LIMIT; } if ( $memory_limit !== \WP_MAX_MEMORY_LIMIT ) { $server_info['Memory limits'] .= ', WP_MAX_MEMORY_LIMIT: ' . \WP_MAX_MEMORY_LIMIT; } return $server_info; } /** * Returns info about the Yoast SEO plugin version and license. * * @param object $plugin The plugin. * * @return string The product info. */ private function get_product_info( $plugin ) { if ( empty( $plugin ) ) { return ''; } $product_info = \sprintf( 'Expiration date %1$s', $plugin->expiry_date ); return $product_info; } /** * Returns the WordPress version + a suffix about the multisite status. * * @return string The WordPress version string. */ private function get_wordpress_version() { global $wp_version; $wordpress_version = $wp_version; if ( \is_multisite() ) { $wordpress_version .= ' (multisite: yes)'; } else { $wordpress_version .= ' (multisite: no)'; } return $wordpress_version; } /** * Returns information about the current theme. * * @return string The theme info as string. */ private function get_theme_info() { $theme = \wp_get_theme(); $theme_info = \sprintf( '%1$s (Version %2$s, %3$s)', \esc_html( $theme->display( 'Name' ) ), \esc_html( $theme->display( 'Version' ) ), \esc_attr( $theme->display( 'ThemeURI' ) ) ); if ( \is_child_theme() ) { $theme_info .= \sprintf( ', this is a child theme of: %1$s', \esc_html( $theme->display( 'Template' ) ) ); } return $theme_info; } /** * Returns a stringified list of all active plugins, separated by a pipe. * * @return string The active plugins. */ private function get_active_plugins() { $updates_available = \get_site_transient( 'update_plugins' ); $active_plugins = ''; foreach ( \wp_get_active_and_valid_plugins() as $plugin ) { $plugin_data = \get_plugin_data( $plugin ); $plugin_file = \str_replace( \trailingslashit( \WP_PLUGIN_DIR ), '', $plugin ); $plugin_update_available = ''; if ( isset( $updates_available->response[ $plugin_file ] ) ) { $plugin_update_available = ' [update available]'; } $active_plugins .= \sprintf( '%1$s (Version %2$s%3$s, %4$s) | ', \esc_html( $plugin_data['Name'] ), \esc_html( $plugin_data['Version'] ), $plugin_update_available, \esc_attr( $plugin_data['PluginURI'] ) ); } return $active_plugins; } /** * Returns a CSV list of all must-use and drop-in plugins. * * @return string The active plugins. */ private function get_mustuse_and_dropins() { $dropins = \get_dropins(); $mustuse_plugins = \get_mu_plugins(); if ( ! \is_array( $dropins ) ) { $dropins = []; } if ( ! \is_array( $mustuse_plugins ) ) { $mustuse_plugins = []; } return \sprintf( 'Must-Use plugins: %1$d, Drop-ins: %2$d', \count( $mustuse_plugins ), \count( $dropins ) ); } /** * Return the indexables status details. * * @return string The indexables status in a string. */ private function get_indexables_status() { $indexables_status = 'Indexing completed: '; $indexing_completed = $this->options->get( 'indexables_indexing_completed' ); $indexing_reason = $this->options->get( 'indexing_reason' ); $indexables_status .= ( $indexing_completed ) ? 'yes' : 'no'; $indexables_status .= ( $indexing_reason ) ? ', latest indexing reason: ' . \esc_html( $indexing_reason ) : ''; foreach ( [ 'free', 'premium' ] as $migration_name ) { $current_status = $this->migration_status->get_error( $migration_name ); if ( \is_array( $current_status ) && isset( $current_status['message'] ) ) { $indexables_status .= ', migration error: ' . \esc_html( $current_status['message'] ); } } return $indexables_status; } /** * Returns language settings for the website and the current user. * * @return string The locale settings of the site and user. */ private function get_language_settings() { $site_locale = \get_locale(); $user_locale = \get_user_locale(); $language_settings = \sprintf( 'Site locale: %1$s, user locale: %2$s', ( \is_string( $site_locale ) ) ? \esc_html( $site_locale ) : 'unknown', ( \is_string( $user_locale ) ) ? \esc_html( $user_locale ) : 'unknown' ); return $language_settings; } /** * Returns the conditionals based on which this integration should be active. * * @return array The array of conditionals. */ public static function get_conditionals() { return [ Admin_Conditional::class ]; } /** * Get the beacon id to use based on the user's subscription and tracking settings. * * @return string The beacon id to use. */ private function get_beacon_id() { // Case where the user has a Yoast WooCommerce SEO plan subscription (highest priority). if ( $this->addon_manager->has_active_addons() && $this->addon_manager->has_valid_subscription( WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ) ) { return $this->beacon_id_woocommerce; } // Case where the user has a Yoast SEO Premium plan subscription. if ( $this->addon_manager->has_active_addons() && $this->addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ) ) { return $this->beacon_id_premium; } // Case where the user has no plan active and tracking enabled. if ( $this->ask_consent ) { return $this->beacon_id_tracking_users; } // Case where the user has no plan active and tracking disabled. return $this->beacon_id; } /** * Allows filtering of the HelpScout settings. Hooked to admin_head to prevent timing issues, not too early, not too late. * * @return void */ protected function filter_settings() { $filterable_helpscout_setting = [ 'products' => $this->products, 'pages_ids' => $this->pages_ids, ]; /** * Filter: 'wpseo_helpscout_beacon_settings' - Allows overriding the HelpScout beacon settings. * * @param string $beacon_settings The HelpScout beacon settings. */ $helpscout_settings = \apply_filters( 'wpseo_helpscout_beacon_settings', $filterable_helpscout_setting ); $this->products = $helpscout_settings['products']; $this->pages_ids = $helpscout_settings['pages_ids']; } } Seite wurde nicht gefunden. - OnlineKladionice.com