Submit
Path:
~
/
home
/
getwphos
/
public_html
/
shellfish
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
File Content:
class-wincher-dashboard-widget.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin */ /** * Wincher dashboard widget. */ class Wincher_Dashboard_Widget implements WPSEO_WordPress_Integration { /** * Holds an instance of the admin asset manager. * * @var WPSEO_Admin_Asset_Manager */ protected $asset_manager; /** * Wincher_Dashboard_Widget constructor. */ public function __construct() { $this->asset_manager = new WPSEO_Admin_Asset_Manager(); } /** * Register WordPress hooks. * * @return void */ public function register_hooks() { add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_wincher_dashboard_assets' ] ); add_action( 'admin_init', [ $this, 'queue_wincher_dashboard_widget' ] ); } /** * Adds the Wincher dashboard widget if it should be shown. * * @return void */ public function queue_wincher_dashboard_widget() { if ( $this->show_widget() ) { add_action( 'wp_dashboard_setup', [ $this, 'add_wincher_dashboard_widget' ] ); } } /** * Adds the Wincher dashboard widget to WordPress. * * @return void */ public function add_wincher_dashboard_widget() { add_filter( 'postbox_classes_dashboard_wpseo-wincher-dashboard-overview', [ $this, 'wpseo_wincher_dashboard_overview_class' ] ); wp_add_dashboard_widget( 'wpseo-wincher-dashboard-overview', /* translators: %1$s expands to Yoast SEO, %2$s to Wincher */ sprintf( __( '%1$s / %2$s: Top Keyphrases', 'wordpress-seo' ), 'Yoast SEO', 'Wincher' ), [ $this, 'display_wincher_dashboard_widget' ] ); } /** * Adds CSS classes to the dashboard widget. * * @param array $classes An array of postbox CSS classes. * * @return array */ public function wpseo_wincher_dashboard_overview_class( $classes ) { $classes[] = 'yoast wpseo-wincherdashboard-overview'; return $classes; } /** * Displays the Wincher dashboard widget. * * @return void */ public function display_wincher_dashboard_widget() { echo '<div id="yoast-seo-wincher-dashboard-widget"></div>'; } /** * Enqueues assets for the dashboard if the current page is the dashboard. * * @return void */ public function enqueue_wincher_dashboard_assets() { if ( ! $this->is_dashboard_screen() ) { return; } $this->asset_manager->localize_script( 'wincher-dashboard-widget', 'wpseoWincherDashboardWidgetL10n', $this->localize_wincher_dashboard_script() ); $this->asset_manager->enqueue_script( 'wincher-dashboard-widget' ); $this->asset_manager->enqueue_style( 'wp-dashboard' ); $this->asset_manager->enqueue_style( 'monorepo' ); } /** * Translates strings used in the Wincher dashboard widget. * * @return array The translated strings. */ public function localize_wincher_dashboard_script() { return [ 'wincher_is_logged_in' => YoastSEO()->helpers->wincher->login_status(), 'wincher_website_id' => WPSEO_Options::get( 'wincher_website_id', '' ), ]; } /** * Checks if the current screen is the dashboard screen. * * @return bool Whether or not this is the dashboard screen. */ private function is_dashboard_screen() { $current_screen = get_current_screen(); return ( $current_screen instanceof WP_Screen && $current_screen->id === 'dashboard' ); } /** * Returns true when the Wincher dashboard widget should be shown. * * @return bool */ private function show_widget() { $analysis_seo = new WPSEO_Metabox_Analysis_SEO(); $user_can_edit = $analysis_seo->is_enabled() && current_user_can( 'edit_posts' ); $is_wincher_active = YoastSEO()->helpers->wincher->is_active(); return $user_can_edit && $is_wincher_active; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
ajax
---
0755
capabilities
---
0755
endpoints
---
0755
exceptions
---
0755
filters
---
0755
formatter
---
0755
google_search_console
---
0755
import
---
0755
listeners
---
0755
menu
---
0755
metabox
---
0755
notifiers
---
0755
pages
---
0755
roles
---
0755
services
---
0755
statistics
---
0755
taxonomy
---
0755
tracking
---
0755
views
---
0755
watchers
---
0755
admin-settings-changed-listener.php
2445 bytes
0644
ajax.php
11509 bytes
0644
class-admin-asset-analysis-worker-location.php
1849 bytes
0644
class-admin-asset-dev-server-location.php
1672 bytes
0644
class-admin-asset-location.php
488 bytes
0644
class-admin-asset-manager.php
19717 bytes
0644
class-admin-asset-seo-location.php
2126 bytes
0644
class-admin-editor-specific-replace-vars.php
6495 bytes
0644
class-admin-gutenberg-compatibility-notification.php
2610 bytes
0644
class-admin-help-panel.php
2760 bytes
0644
class-admin-init.php
10970 bytes
0644
class-admin-recommended-replace-vars.php
6128 bytes
0644
class-admin-user-profile.php
3323 bytes
0644
class-admin-utils.php
2196 bytes
0644
class-admin.php
13447 bytes
0644
class-asset.php
4405 bytes
0644
class-bulk-description-editor-list-table.php
2100 bytes
0644
class-bulk-editor-list-table.php
30105 bytes
0644
class-bulk-title-editor-list-table.php
2286 bytes
0644
class-collector.php
1005 bytes
0644
class-config.php
5207 bytes
0644
class-database-proxy.php
7684 bytes
0644
class-export.php
3541 bytes
0644
class-expose-shortlinks.php
8791 bytes
0644
class-gutenberg-compatibility.php
2529 bytes
0644
class-meta-columns.php
25474 bytes
0644
class-my-yoast-proxy.php
6287 bytes
0644
class-option-tab.php
2268 bytes
0644
class-option-tabs-formatter.php
2905 bytes
0644
class-option-tabs.php
2311 bytes
0644
class-paper-presenter.php
3600 bytes
0644
class-plugin-availability.php
10296 bytes
0644
class-plugin-conflict.php
4141 bytes
0644
class-premium-popup.php
2874 bytes
0644
class-premium-upsell-admin-block.php
5236 bytes
0644
class-primary-term-admin.php
7524 bytes
0644
class-product-upsell-notice.php
5886 bytes
0644
class-remote-request.php
3203 bytes
0644
class-schema-person-upgrade-notification.php
2284 bytes
0644
class-suggested-plugins.php
4429 bytes
0644
class-wincher-dashboard-widget.php
3615 bytes
0644
class-yoast-columns.php
3602 bytes
0644
class-yoast-dashboard-widget.php
4055 bytes
0644
class-yoast-form.php
36591 bytes
0644
class-yoast-input-validation.php
7357 bytes
0644
class-yoast-network-admin.php
10208 bytes
0644
class-yoast-network-settings-api.php
4276 bytes
0644
class-yoast-notification-center.php
26710 bytes
0644
class-yoast-notification.php
10054 bytes
0644
class-yoast-notifications.php
7812 bytes
0644
class-yoast-plugin-conflict.php
10576 bytes
0644
index.php
38 bytes
0644
interface-collection.php
257 bytes
0644
interface-installable.php
254 bytes
0644
N4ST4R_ID | Naxtarrr