field-bulk-edit.php
8 months ago
field-meta-box-news.php
7 months ago
field-meta-box.php
6 months ago
field-news-categories.php
7 months ago
field-news-hierarchical.php
6 months ago
field-news-keywords.php
6 months ago
field-news-name.php
9 months ago
field-news-notifier.php
5 months ago
field-news-post-type.php
8 months ago
field-news-stocktickers.php
6 months ago
field-quick-edit.php
11 months ago
field-robots.php
11 months ago
field-sitemap-author-settings.php
6 months ago
field-sitemap-authors.php
7 months ago
field-sitemap-custom.php
11 months ago
field-sitemap-disable.php
11 months ago
field-sitemap-notifier.php
2 months ago
field-sitemap-post-type-settings.php
2 months ago
field-sitemap-post-types-limit.php
11 months ago
field-sitemap-post-types.php
7 months ago
field-sitemap-server.php
6 months ago
field-sitemap-slug.php
8 months ago
field-sitemap-taxonomies.php
7 months ago
field-sitemap-taxonomy-settings.php
6 months ago
field-sitemap-urls.php
11 months ago
field-sitemaps.php
11 months ago
help-tab-advanced.php
6 months ago
help-tab-authors.php
6 months ago
help-tab-news-categories.php
11 months ago
help-tab-news-hierarchical.php
8 months ago
help-tab-news-keywords.php
11 months ago
help-tab-news-name.php
11 months ago
help-tab-news-notifier.php
6 months ago
help-tab-news-post-types.php
11 months ago
help-tab-news-sidebar.php
11 months ago
help-tab-news-stocktickers.php
11 months ago
help-tab-news.php
11 months ago
help-tab-post-types-general.php
11 months ago
help-tab-post-types.php
6 months ago
help-tab-robots.php
11 months ago
help-tab-sidebar.php
11 months ago
help-tab-sitemaps.php
11 months ago
help-tab-support.php
6 months ago
help-tab-taxonomies.php
6 months ago
notice-xmlsf-advanced-news.php
11 months ago
notice-xmlsf-advanced.php
11 months ago
page-sitemap-news.php
6 months ago
page-sitemap.php
7 months ago
section-advanced-compat-message.php
9 months ago
section-advanced-intro.php
11 months ago
section-advanced-news-compat-message.php
9 months ago
section-bwt-data.php
2 months ago
section-bwt-oauth-intro.php
6 months ago
section-bwt-oauth-stage-1.php
6 months ago
section-bwt-oauth-stage-2.php
6 months ago
section-gsc-data-news.php
3 months ago
section-gsc-data.php
2 months ago
section-gsc-oauth-intro.php
6 months ago
section-gsc-oauth-stage-1-2.php
2 months ago
section-gsc-oauth-stage-3.php
6 months ago
section-ping-log.php
3 months ago
sidebar-advanced-plug.php
2 months ago
sidebar-bwt-connect.php
6 months ago
sidebar-contribute.php
9 months ago
sidebar-gsc-connect.php
6 months ago
sidebar-help.php
6 months ago
sidebar-links.php
6 months ago
sidebar-news-advanced-plug.php
6 months ago
sidebar-news-links.php
6 months ago
sidebar-news-tools.php
7 months ago
sidebar-priority-support.php
7 months ago
sidebar-tools.php
7 months ago
section-bwt-data.php
102 lines
| 1 | <?php |
| 2 | /** |
| 3 | * BWT data section |
| 4 | * |
| 5 | * @package XML Sitemap & Google News |
| 6 | */ |
| 7 | |
| 8 | if ( ! \XMLSF\BWT_Connect::is_connected() ) { |
| 9 | // Initiate button. |
| 10 | ?> |
| 11 | <p> |
| 12 | <?php printf( /* translators: %s: Bing Webmaster Tools */ esc_html_x( 'Connect to %s for sitemap data retrieval and sitemap submissions.', 'Bing Webmaster Tools connection', 'xml-sitemap-feed' ), esc_html__( 'Bing Webmaster Tools', 'xml-sitemap-feed' ) ); ?> |
| 13 | </p> |
| 14 | <p> |
| 15 | <a href="<?php echo esc_url( \XMLSF\Admin\BWT_Connect::get_settings_url() ); ?>" class="button button-small"> |
| 16 | <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?> |
| 17 | </a> |
| 18 | </p> |
| 19 | <?php |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | // Get connect data. |
| 24 | $sitemap = xmlsf()->sitemap->get_sitemap_url(); |
| 25 | $parsed_url = parse_url( $sitemap ); |
| 26 | $path = $parsed_url['path']; |
| 27 | $data = \XMLSF\BWT_Connect::get( $sitemap ); |
| 28 | |
| 29 | ?> |
| 30 | <p><?php esc_html_e( 'Your sitemap data as reported by Bing Webmaster Tools.', 'xml-sitemap-feed' ); ?></p> |
| 31 | <?php |
| 32 | if ( \is_wp_error( $data ) ) { |
| 33 | // Display error message. |
| 34 | ?> |
| 35 | <p style="color:#d63638"> |
| 36 | <?php esc_html_e( 'There was an error requesting sitemap data from Bing Webmaster Tools.', 'xml-sitemap-feed' ); ?> |
| 37 | <br> |
| 38 | <?php echo esc_html( $data->get_error_message() ); ?> |
| 39 | </p> |
| 40 | <p> |
| 41 | <a href="" class="button button-small"><?php echo esc_html( translate( 'Retry' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a> |
| 42 | </p> |
| 43 | <?php |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | if ( count( $data['d'] ) < 1 ) { |
| 48 | ?> |
| 49 | <p style="color:#d63638"> |
| 50 | <?php esc_html_e( 'There was an error requesting sitemap data from Bing Webmaster Tools.', 'xml-sitemap-feed' ); ?> |
| 51 | <br> |
| 52 | <?php printf( /* translators: %s: Bing Webmaster Tools */ esc_html__( 'Your sitemap was not found on %s. Maybe submit it first?', 'xml-sitemap-feed' ), esc_html__( 'Bing Webmaster Tools', 'xml-sitemap-feed' ) ); ?> |
| 53 | </p> |
| 54 | <?php |
| 55 | return; |
| 56 | } |
| 57 | |
| 58 | $data = $data['d'][0]; |
| 59 | $format = get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ); |
| 60 | $last_submitted = isset( $data['Submitted'] ) ? wp_date( $format, substr( $data['Submitted'], 6, 10 ) ) : __( 'Unknown', 'xml-sitemap-feed' ); |
| 61 | $last_downloaded = isset( $data['LastCrawled'] ) ? wp_date( $format, substr( $data['LastCrawled'], 6, 10 ) ) : __( 'Unknown', 'xml-sitemap-feed' ); |
| 62 | $links_submitted = isset( $data['UrlCount'] ) ? $data['UrlCount'] : 0; |
| 63 | $bwt_link = add_query_arg( |
| 64 | array( |
| 65 | 'siteUrl' => rawurlencode( \home_url() ), |
| 66 | 'sitemapIndex' => rawurlencode( $sitemap ), |
| 67 | ), |
| 68 | 'https://www.bing.com/webmasters/sitemaps' |
| 69 | ); |
| 70 | // https://www.bing.com/webmasters/sitemaps?siteUrl=https%3A%2F%2Fdev.status301.com%2F&sitemapIndex=https%3A%2F%2Fdev.status301.com%2Fwp-sitemap.xml&activePivot=1 . |
| 71 | ?> |
| 72 | <table class="widefat"> |
| 73 | <thead> |
| 74 | <tr> |
| 75 | <th><?php esc_html_e( 'XML Sitemap Index', 'xml-sitemap-feed' ); ?></th> |
| 76 | <th><?php esc_html_e( 'Status', 'xml-sitemap-feed' ); ?></th> |
| 77 | <th><?php esc_html_e( 'Last submitted', 'xml-sitemap-feed' ); ?></th> |
| 78 | <th><?php esc_html_e( 'Last crawled', 'xml-sitemap-feed' ); ?></th> |
| 79 | <th><?php esc_html_e( 'Sitemaps', 'xml-sitemap-feed' ); ?></th> |
| 80 | </tr> |
| 81 | </thead> |
| 82 | <tbody> |
| 83 | <tr> |
| 84 | <th> |
| 85 | <a href="<?php echo esc_url( $bwt_link ); ?>" target="_blank" title="<?php esc_html_e( 'View this sitemap in Bing Webmaster Tools', 'xml-sitemap-feed' ); ?>"> |
| 86 | <?php echo esc_html( $parsed_url['path'] ); ?> |
| 87 | <span class="dashicons dashicons-external"></span> |
| 88 | </a> |
| 89 | </th> |
| 90 | <td><?php if ( isset( $data['Status'] ) && 'Success' !== $data['Status'] ) : ?> |
| 91 | <span class="dashicons dashicons-clock" style="color:#dba617" title="<?php esc_html_e( 'Pending', 'xml-sitemap-feed' ); ?>"></span> |
| 92 | <?php else : ?> |
| 93 | <span class="dashicons dashicons-yes-alt" style="color:#00a32a" title="<?php esc_html_e( 'Processed', 'xml-sitemap-feed' ); ?>"></span> |
| 94 | <?php endif; ?> |
| 95 | </td> |
| 96 | <td><?php echo esc_html( $last_submitted ); ?></td> |
| 97 | <td><?php echo esc_html( $last_downloaded ); ?></td> |
| 98 | <td><?php echo esc_html__( 'Found:', 'xml-sitemap-feed' ) . ' ' . esc_html( $links_submitted ); ?></td> |
| 99 | </tr> |
| 100 | </tbody> |
| 101 | </table> |
| 102 |