PluginProbe
Analytify – Google Analytics 4 Tracking and Reporting in WordPress / 1.3.1
Analytify – Google Analytics 4 Tracking and Reporting in WordPress v1.3.1
9.1.2 9.1.1 9.1.0 9.0.2 9.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 All 153 releases
wp-analytify / inc / page-addons.php

page-addons.php in Analytify – Google Analytics 4 Tracking and Reporting in WordPress 1.3.1, at inc/page-addons.php

109 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Analytify page addons file.
4 * @package WP_Analytify
5 */
6
7 if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly.
8 }
9 if ( ! class_exists( 'WP_Analytify_Addons' ) ) {
10
11 class WP_Analytify_Addons {
12
13 protected $plugins_list;
14
15 /**
16 * Constructor
17 */
18 public function __construct() {
19
20 $this->plugins_list = get_plugins();
21
22 }
23
24 /**
25 * Returns a list of addons
26 *
27 * @return array
28 * @since 1.3
29 */
30 public function addons() {
31
32 $addons = array(
33 'wp_analytify_woo' => (object) array(
34 'url' => 'https://wp-analytify.com/add-ons/woocommerce/?utm_medium=free&utm_source=extensions_page',
35 'slug' => 'wp-analytify-woocommerce/wp-analytify-woocommerce.php',
36 'title' => __( 'Enhaced E-Commerce Tracking for WooCommerce', 'wp-analytify' ),
37 'status' => '',
38 'description' => __( 'Our WooCommerce Addon takes Analytics into next level. And its absolutely no-setup needed. So you get World Class data on your shop by just enabling an add-on. Sweet!', 'wp-analytify' ),
39 ),
40 'wp_analytify_dash' => (object) array(
41 'url' => 'https://wp-analytify.com/',
42 'slug' => 'wp-analytify-dashboard/wp-analytify-dashboard.php',
43 'title' => __( 'Analytify Stats', 'wp-analytify' ) . '<br />' . __( 'on WordPress Dashboard', 'wp-analytify' ),
44 'status' => 'Coming soon',
45 'description' => __( 'This Add-on dispays your site Analytics as widgets at WordPress Dashboard. <br><br> It is completely Free.', 'wp-analytify' ),
46 ),
47 );
48
49 return $addons;
50 }
51
52
53 /**
54 * Check plugin status
55 *
56 * @return array
57 * @since 1.3
58 */
59 public function check_plugin_status( $slug, $extension ) {
60
61 if ( is_plugin_active( $slug ) ) {
62
63 echo '<button class="button-primary">' . __( 'Already Installed', 'wp-analytify' ) . '</button>';
64
65 } else if ( array_key_exists( $slug, $this->plugins_list ) ) {
66
67 echo '<a href="' . admin_url( 'plugins.php' ) . '" class="button-primary">' . __( 'Activate Plugin', 'wp-analytify' ) . '</a>';
68
69 } else if ( is_plugin_inactive( $slug ) ) {
70
71 if ( $extension->status != '' ) {
72 echo '<a target="_blank" href="' . $extension->url . '" class="button-primary">' . __( 'Coming Soon', 'wp-analytify' ) . '</a>';
73 } else { echo '<a target="_blank" href="' . $extension->url . '" class="button-primary">' . __( 'Get this add-on', 'wp-analytify' ) . '</a>'; }
74 }
75 }
76 }
77
78 }
79
80 $obj_wp_analytify_addons = new WP_Analytify_Addons;
81 $addons = $obj_wp_analytify_addons->addons();
82 ?>
83
84 <div class="wrap">
85
86 <h2 class='opt-title'><span id='icon-options-general' class='analytics-options'><img src="<?php echo plugins_url( 'images/wp-analytics-logo.png', dirname( __FILE__ ) );?>" alt=""></span>
87 <?php echo __( 'Extend the functionality of Analytify with these awesome Add-ons', 'wp-analytify' ); ?>
88 </h2>
89
90 <div class="tabwrapper">
91 <?php
92 foreach ( $addons as $name => $extension ) :
93 ?>
94 <div class="wp-extension <?php echo $name; ?>">
95 <a target="_blank" href="<?php echo $extension->url; ?>">
96
97 <h3><?php echo $extension->title; ?></h3>
98 </a>
99
100 <p><?php echo $extension->description; ?></p>
101 <p>
102 <?php $obj_wp_analytify_addons->check_plugin_status( $extension->slug, $extension ); ?>
103 </p>
104 </div>
105 <?php endforeach; ?>
106 </div>
107
108 </div>
109