PluginProbe ʕ •ᴥ•ʔ
XML Sitemap & Google News / trunk
XML Sitemap & Google News vtrunk
5.7.7 5.7.5 5.7.6 5.7.4 trunk 1.0 2.0 2.1 3.0 3.2 3.3 3.4 3.5 3.6.1 3.7.4 3.8.8 3.9.3 4.0.1 4.1.4 4.2.3 4.3.2 4.4.1 4.5.1 4.6.3 4.7.5 4.8.3 4.9.4 5.0.7 5.1.2 5.2.7 5.3.6 5.4.6 5.4.9 5.5.1 5.5.2 5.5.3 5.5.4 5.5.5 5.5.6 5.5.7 5.5.8 5.5.9 5.6 5.6.1 5.6.2 5.6.3 5.7 5.7.1 5.7.2 5.7.3
xml-sitemap-feed / views / admin / section-gsc-data-news.php
xml-sitemap-feed / views / admin Last commit date
field-bulk-edit.php 9 months ago field-meta-box-news.php 9 months ago field-meta-box.php 7 months ago field-news-categories.php 9 months ago field-news-hierarchical.php 7 months ago field-news-keywords.php 7 months ago field-news-name.php 10 months ago field-news-notifier.php 7 months ago field-news-post-type.php 9 months ago field-news-stocktickers.php 7 months ago field-quick-edit.php 1 year ago field-robots.php 1 year ago field-sitemap-author-settings.php 7 months ago field-sitemap-authors.php 9 months ago field-sitemap-custom.php 1 year ago field-sitemap-disable.php 1 year ago field-sitemap-notifier.php 3 months ago field-sitemap-post-type-settings.php 3 months ago field-sitemap-post-types-limit.php 1 year ago field-sitemap-post-types.php 9 months ago field-sitemap-server.php 7 months ago field-sitemap-slug.php 9 months ago field-sitemap-taxonomies.php 9 months ago field-sitemap-taxonomy-settings.php 7 months ago field-sitemap-urls.php 1 year ago field-sitemaps.php 1 year ago help-tab-advanced.php 7 months ago help-tab-authors.php 7 months ago help-tab-news-categories.php 1 year ago help-tab-news-hierarchical.php 9 months ago help-tab-news-keywords.php 1 year ago help-tab-news-name.php 1 year ago help-tab-news-notifier.php 7 months ago help-tab-news-post-types.php 1 year ago help-tab-news-sidebar.php 1 year ago help-tab-news-stocktickers.php 1 year ago help-tab-news.php 1 year ago help-tab-post-types-general.php 1 year ago help-tab-post-types.php 7 months ago help-tab-robots.php 1 year ago help-tab-sidebar.php 1 year ago help-tab-sitemaps.php 1 year ago help-tab-support.php 7 months ago help-tab-taxonomies.php 7 months ago notice-xmlsf-advanced-news.php 1 year ago notice-xmlsf-advanced.php 1 year ago page-sitemap-news.php 7 months ago page-sitemap.php 9 months ago section-advanced-compat-message.php 10 months ago section-advanced-intro.php 1 year ago section-advanced-news-compat-message.php 10 months ago section-bwt-data.php 3 months ago section-bwt-oauth-intro.php 7 months ago section-bwt-oauth-stage-1.php 7 months ago section-bwt-oauth-stage-2.php 7 months ago section-gsc-data-news.php 4 months ago section-gsc-data.php 3 months ago section-gsc-oauth-intro.php 7 months ago section-gsc-oauth-stage-1-2.php 3 months ago section-gsc-oauth-stage-3.php 7 months ago section-ping-log.php 4 months ago sidebar-advanced-plug.php 3 months ago sidebar-bwt-connect.php 7 months ago sidebar-contribute.php 10 months ago sidebar-gsc-connect.php 7 months ago sidebar-help.php 7 months ago sidebar-links.php 7 months ago sidebar-news-advanced-plug.php 7 months ago sidebar-news-links.php 7 months ago sidebar-news-tools.php 9 months ago sidebar-priority-support.php 9 months ago sidebar-tools.php 9 months ago
section-gsc-data-news.php
105 lines
1 <?php
2 /**
3 * GSC data section
4 *
5 * @package XML Sitemap & Google News
6 */
7
8 if ( ! \XMLSF\GSC_Connect::is_connected() ) {
9 // Initiate button.
10 ?>
11 <p>
12 <?php printf( /* translators: %s: Google Search Console */ esc_html_x( 'Connect to %s for sitemap data retrieval and sitemap submissions.', 'Google Search Console connection', 'xml-sitemap-feed' ), esc_html__( 'Google Search Console', 'xml-sitemap-feed' ) ); ?>
13 </p>
14 <p>
15 <a href="<?php echo esc_url( add_query_arg( 'ref', 'xmlsf_news', XMLSF\Admin\GSC_Connect::get_settings_url() ) ); ?>" class="button button-primary">
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_news->get_sitemap_url();
25 $parsed_url = parse_url( $sitemap );
26 $path = $parsed_url['path'];
27 $data = \XMLSF\GSC_Connect::get( $sitemap );
28
29 ?>
30 <p><?php esc_html_e( 'Your sitemap data as reported by Google Search Console.', '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 Google Search Console.', 'xml-sitemap-feed' ); ?>
37 <br>
38 <?php echo esc_html( $data->get_error_message() ); ?>
39 </p>
40 <p>
41 <a href="" class="button button-primary"><?php echo esc_html( translate( 'Retry' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a>
42 </p>
43 <?php
44
45 return;
46 }
47
48 $format = get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' );
49 $last_submitted = isset( $data['lastSubmitted'] ) ? wp_date( $format, strtotime( $data['lastSubmitted'] ) ) : __( 'Unknown', 'xml-sitemap-feed' );
50 $is_pending = isset( $data['isPending'] ) ? $data['isPending'] : false;
51 $last_downloaded = isset( $data['lastDownloaded'] ) ? wp_date( $format, strtotime( $data['lastDownloaded'] ) ) : __( 'Unknown', 'xml-sitemap-feed' );
52 $_warnings = isset( $data['warnings'] ) ? $data['warnings'] : 0;
53 $_errors = isset( $data['errors'] ) ? $data['errors'] : 0;
54 $property = \XMLSF\Admin\GSC_Connect::get_property_url();
55 $gsc_link = add_query_arg(
56 array(
57 'resource_id' => rawurlencode( $property ),
58 'sitemap' => rawurlencode( $sitemap ),
59 ),
60 'https://search.google.com/search-console/sitemaps/info-drilldown'
61 );
62 $links_submitted = 0;
63 if ( isset( $data['contents'] ) && is_array( $data['contents'] ) ) {
64 foreach ( $data['contents'] as $content ) {
65 if ( isset( $content['type'] ) && 'news' === $content['type'] ) {
66 $links_submitted = $content['submitted'];
67 break;
68 }
69 }
70 }
71
72 ?>
73 <table class="widefat">
74 <thead>
75 <tr>
76 <th><?php esc_html_e( 'XML Sitemap', 'xml-sitemap-feed' ); ?></th>
77 <th><?php esc_html_e( 'Status', 'xml-sitemap-feed' ); ?></th>
78 <th><?php esc_html_e( 'Last submitted', 'xml-sitemap-feed' ); ?></th>
79 <th><?php esc_html_e( 'Last crawled', 'xml-sitemap-feed' ); ?></th>
80 <th><?php esc_html_e( 'URLs', 'xml-sitemap-feed' ); ?></th>
81 <th><?php esc_html_e( 'Issues', 'xml-sitemap-feed' ); ?></th>
82 </tr>
83 </thead>
84 <tbody>
85 <tr>
86 <th>
87 <a href="<?php echo esc_url( $gsc_link ); ?>" target="_blank" title="<?php esc_html_e( 'View this sitemap in Google Search Console', 'xml-sitemap-feed' ); ?>">
88 <?php echo esc_html( $parsed_url['path'] ); ?>
89 <span class="dashicons dashicons-external"></span>
90 </a>
91 </th>
92 <td><?php if ( $is_pending ) : ?>
93 <span class="dashicons dashicons-clock" style="color:#dba617" title="<?php esc_html_e( 'Pending', 'xml-sitemap-feed' ); ?>"></span>
94 <?php else : ?>
95 <span class="dashicons dashicons-yes-alt" style="color:#00a32a" title="<?php echo esc_html_e( 'Processed', 'xml-sitemap-feed' ); ?>"></span>
96 <?php endif; ?>
97 </td>
98 <td><?php echo esc_html( $last_submitted ); ?></td>
99 <td><?php echo esc_html( $last_downloaded ); ?></td>
100 <td><?php echo esc_html__( 'Found:', 'xml-sitemap-feed' ) . ' ' . esc_html( $links_submitted ); ?></td>
101 <td style="color:<?php echo $_errors ? '#d63638' : ( $_warnings ? '#dba617' : 'inherit' ); ?>"><?php echo esc_html__( 'Warnings:', 'xml-sitemap-feed' ) . ' ' . esc_html( $_warnings ) . '<br>' . esc_html__( 'Errors:', 'xml-sitemap-feed' ) . ' ' . esc_html( $_errors ); ?></td>
102 </tr>
103 </tbody>
104 </table>
105