PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.54
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.54
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / public / admin / class-pluginactionsmanager.php

class-pluginactionsmanager.php in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.0.54, at public/admin/class-pluginactionsmanager.php

56 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Leadin\admin;
4
5 use Leadin\data\Filters;
6 use Leadin\admin\Links;
7 use Leadin\admin\Connection;
8 use Leadin\data\Portal_Options;
9
10 /**
11 * Class responsible for the custom functionalities inside the plugins.php page.
12 */
13 class PluginActionsManager {
14 /**
15 * Class constructor, adds the necessary hooks.
16 */
17 public function __construct() {
18 add_filter( 'plugin_action_links_leadin/leadin.php', array( $this, 'add_plugin_settings_link' ) );
19 add_filter( 'plugin_action_links_leadin/leadin.php', array( $this, 'leadin_plugin_advanced_features_link' ) );
20 }
21
22 /**
23 * Adds setting link for Leadin to plugins management page.
24 *
25 * @param array $links Return the links for the settings page.
26 * @return array
27 */
28 public function add_plugin_settings_link( $links ) {
29 if ( Connection::is_connected() ) {
30 $page = 'leadin_settings';
31 } else {
32 $page = 'leadin';
33 }
34 $url = get_admin_url( get_current_blog_id(), "admin.php?page=$page" );
35 $settings_link = '<a href="' . $url . '">' . __( 'Settings', 'leadin' ) . '</a>';
36 array_unshift( $links, $settings_link );
37 return $links;
38 }
39
40 /**
41 * Adds upgrade link for Leadin to plugins management page
42 *
43 * @param array $links Return the links for the upgrade page.
44 * @return array
45 */
46 public function leadin_plugin_advanced_features_link( $links ) {
47 if ( Connection::is_connected() ) {
48 $portal_id = Portal_Options::get_portal_id();
49 $url = Filters::apply_base_url_filters() . '/pricing/' . $portal_id . '/marketing?' . Links::get_query_params();
50 $advanced_features_link = '<a class="hubspot-menu-pricing" target="_blank" rel="noopener" href="' . esc_attr( $url ) . '">' . esc_html( __( 'Upgrade', 'leadin' ) ) . '</a>';
51 array_push( $links, $advanced_features_link );
52 }
53 return $links;
54 }
55 }
56