Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
declare(strict_types=1);

namespace Imagify\Admin;

use Imagify\EventManagement\SubscriberInterface;
use Imagify\User\User;

/**
 * Admin Subscriber
 */
class AdminSubscriber implements SubscriberInterface {

	/**
	 * User instance.
	 *
	 * @var User
	 */
	protected $user;

	/**
	 * Instantiate the class
	 *
	 * @param User $user User instance.
	 */
	public function __construct( User $user ) {
		$this->user = $user;
	}

	/**
	 * Returns an array of events this subscriber listens to
	 *
	 * @return array
	 */
	public static function get_subscribed_events() {
		$basename = plugin_basename( IMAGIFY_FILE );

		return [
			'plugin_action_links_' . $basename => 'plugin_action_links',
			'network_admin_plugin_action_links_' . $basename => 'plugin_action_links',
		];
	}

	/**
	 * Add links to the plugin row in the plugins list.
	 *
	 * @since 1.7
	 *
	 * @param  array $actions An array of action links.
	 * @return array
	 */
	public function plugin_action_links( $actions ) {
		$text  = 1 !== $this->user->get_plan_id() ? __( 'Documentation', 'imagify' ) : __( 'Upgrade', 'imagify' );
		$url   = 1 !== $this->user->get_plan_id() ? 'documentation' : 'subscription';
		$class = 1 !== $this