ID, $disallowed_posts)) { return; } $post_title = urlencode($post->post_title); $site_url = get_site_url(); $main_site_title = get_bloginfo('name'); $custom_url = isset($options['custom_search_url']) && !empty($options['custom_search_url']) ? $options['custom_search_url'] : 'https://www.google.com/search?q={post_title}+-{site_title}+site:{site_url}'; $google_search_url = str_replace( ['{post_title}', '{site_title}', '{site_url}'], [$post_title, urlencode($main_site_title), $site_url], $custom_url ); wp_enqueue_script('traffic-converter-script', plugin_dir_url(__FILE__) . 'assets/js/traffic-converter.js', array(), '1.0', true); wp_localize_script('traffic-converter-script', 'TrafficConverterData', array( 'googleSearchUrl' => $google_search_url )); wp_enqueue_style('traffic-converter-style', plugin_dir_url(__FILE__) . 'assets/css/traffic-converter.css'); ?> ' style="width: 100%;">

Use placeholders: {post_title}, {site_title}, {site_url}

-1)); $disallowed_posts = $options['disallowed_posts'] ?? []; ?>

Select posts where the Google search redirect should NOT work.

{$message} {$button_text}

"; add_admin_notification_styles(); add_admin_notification_scripts(); } function add_admin_notification_styles() { ?> Failed to fetch update information. Please try again later.

'; return; } $data = json_decode(wp_remote_retrieve_body($response), true); if (empty($data) || !isset($data['version']) || !isset($data['download_url'])) { echo '

Invalid update information received. Please check the response.

'; return; } $current_version = '1.0.1'; $latest_version = $data['version']; $download_url = $data['download_url']; if (version_compare($current_version, $latest_version, '<')) { echo '

New ' . esc_html($latest_version) . ' Available for Google Organic Traffic Plugin - Download here. Any problems, contact support.

'; } }