function no_items() { $site = WP_Stream::$api->get_site(); $plan_type = WP_Stream::$api->get_plan_type(); $plan_retention = WP_Stream::$api->get_plan_retention(); if ('free' === $plan_type && !empty($plan_retention) && 0 !== $this->get_total_found_rows()) { ?> <div class="stream-list-table-upgrade"> <p><?php printf(_n('Your free account is limited to viewing <strong>1 day</strong> of activity history.', 'Your free account is limited to viewing <strong>%d days</strong> of activity history.', absint($plan_retention), 'stream'), absint($plan_retention)); ?> </p> <p><a href="<?php echo esc_url(WP_Stream_Admin::account_url(sprintf('upgrade?site_uuid=%s', WP_Stream::$api->site_uuid))); ?> " class="button button-primary button-large"><?php _e('Upgrade to Pro', 'stream'); ?> </a></p> </div> <?php } else { _e('Sorry, no activity records were found.', 'stream'); } }
public static function in_admin_header() { ?> <div class="stream-example"> <div class="stream-example-modal"> <h1><i class="dashicons dashicons-chart-area"></i> <?php _e('Stream Reports', 'stream'); ?> </h1> <p><?php _e('Generate stunning visuals of logged-in user activity and share them with stakeholders or your clients.', 'stream'); ?> </p> <ul> <li><i class="dashicons dashicons-yes"></i> <?php _e('Fully-interactive charts', 'stream'); ?> </li> <li><i class="dashicons dashicons-yes"></i> <?php _e('Monitor team contributions', 'stream'); ?> </li> <li><i class="dashicons dashicons-yes"></i> <?php _e('Responsive for any screen size', 'stream'); ?> </li> </ul> <a href="<?php echo esc_url(WP_Stream_Admin::account_url(sprintf('upgrade?site_uuid=%s', WP_Stream::$api->site_uuid))); ?> " class="button button-primary button-large"><?php _e('Upgrade to Pro', 'stream'); ?> </a> </div> </div> <?php }
/** * Render account page * * @return void */ public static function render_account_page() { $page_title = apply_filters('wp_stream_account_page_title', get_admin_page_title()); $date_format = get_option('date_format'); $site_details = WP_Stream::$api->get_site(); ?> <div class="wrap"> <h2><?php echo esc_html($page_title); ?> </h2> <div class="postbox"> <?php if (!$site_details) { ?> <h3><?php esc_html_e('Error retrieving account details.'); ?> </h3> <div class="plan-details"> <p><?php esc_html_e('If this problem persists, please disconnect from Stream and try connecting again.', 'stream'); ?> </p> </div> <div class="plan-actions submitbox"> <a class="submitdelete disconnect" href="<?php echo esc_url(add_query_arg('disconnect', '1')); ?> ">Disconnect</a> </div> <?php } else { $plan_label = __('Free', 'stream'); if (isset($site_details->plan)) { if (0 === strpos($site_details->plan->type, 'pro')) { $plan_label = __('Pro', 'stream'); } elseif (0 === strpos($site_details->plan->type, 'standard')) { $plan_label = __('Standard', 'stream'); } } if ('free' !== $site_details->plan->type) { $next_billing_label = sprintf(_x('$%1$s on %2$s', '1: Price, 2: Renewal date', 'stream'), isset($site_details->plan->amount) ? $site_details->plan->amount : 0, isset($site_details->expiry->date) ? date_i18n($date_format, strtotime($site_details->expiry->date)) : __('N/A', 'stream')); } $retention_label = ''; if (0 == $site_details->plan->retention) { // Loose comparison needed $retention_label = __('Unlimited', 'stream'); } else { $retention_label = sprintf(_n('1 Day', '%s Days', $site_details->plan->retention, 'stream'), $site_details->plan->retention); } ?> <h3><?php echo esc_html($site_details->site_url); ?> </h3> <div class="plan-details"> <table class="form-table"> <tbody> <tr> <th><?php _e('Plan', 'stream'); ?> </th> <td><?php echo esc_html($plan_label); ?> </td> </tr> <tr> <th><?php _e('Activity History', 'stream'); ?> </th> <td><?php echo esc_html($retention_label); ?> </td> </tr> <?php if ('free' !== $site_details->plan->type) { ?> <tr> <th><?php _e('Next Billing', 'stream'); ?> </th> <td><?php echo esc_html($next_billing_label); ?> </td> </tr> <?php } ?> <tr> <th><?php _e('Created', 'stream'); ?> </th> <td><?php echo esc_html(date_i18n($date_format, strtotime($site_details->created))); ?> </td> </tr> <tr> <th><?php _e('Site ID', 'stream'); ?> </th> <td> <code class="site-uuid"><?php echo esc_html(WP_Stream::$api->site_uuid); ?> </code> </td> </tr> <tr> <th><?php _e('API Key', 'stream'); ?> </th> <td> <code class="api-key"><?php echo esc_html(WP_Stream::$api->api_key); ?> </code> </td> </tr> </tbody> </table> </div> <div class="plan-actions submitbox"> <?php if ('free' === $site_details->plan->type) { ?> <a href="<?php echo esc_url(WP_Stream_Admin::account_url(sprintf('upgrade/?site_uuid=%s', WP_Stream::$api->site_uuid))); ?> " class="button button-primary button-large"><?php _e('Upgrade to Pro', 'stream'); ?> </a> <?php } else { ?> <a href="<?php echo esc_url(sprintf('%s/dashboard/?site_uuid=%s', self::PUBLIC_URL, WP_Stream::$api->site_uuid)); ?> " class="button button-primary button-large" target="_blank"><?php _e('Modify This Plan', 'stream'); ?> </a> <?php } ?> <a class="submitdelete disconnect" href="<?php echo esc_url(add_query_arg('disconnect', '1')); ?> ">Disconnect</a> </div> <?php } ?> </div> </div> <?php }
/** * Render account page * * @return void */ public static function render_account_page() { $page_title = apply_filters('wp_stream_account_page_title', get_admin_page_title()); $date_format = get_option('date_format'); $site = WP_Stream::$api->get_site(); $plan_type = WP_Stream::$api->get_plan_type(); $plan_type_label = WP_Stream::$api->get_plan_type_label(); $plan_retention = WP_Stream::$api->get_plan_retention(); $plan_retention_label = WP_Stream::$api->get_plan_retention_label(); $plan_amount = WP_Stream::$api->get_plan_amount(); $expiry_date = WP_Stream::$api->get_expiry_date(); $created_date = WP_Stream::$api->get_created_date(); ?> <div class="wrap"> <h2><?php echo esc_html($page_title); ?> </h2> <div class="postbox"> <?php if (!$site) { ?> <h3><?php _e('Error retrieving account details.'); ?> </h3> <div class="plan-details"> <p><?php _e('If this problem persists, please disconnect from Stream and try connecting again.', 'stream'); ?> </p> </div> <div class="plan-actions submitbox"> <a class="submitdelete disconnect" href="<?php echo esc_url(add_query_arg('disconnect', '1')); ?> "><?php _e('Disconnect', 'stream'); ?> </a> </div> <?php } else { ?> <h3><?php echo esc_html($site->site_url); ?> </h3> <div class="plan-details"> <table class="form-table"> <tbody> <tr> <th><?php _e('Plan', 'stream'); ?> </th> <td><?php echo esc_html($plan_type_label); ?> </td> </tr> <tr> <th><?php _e('Activity History', 'stream'); ?> </th> <td><?php echo esc_html($plan_retention_label); ?> </td> </tr> <?php if ('free' !== $plan_type) { ?> <?php $next_billing_label = sprintf(_x('$%1$s on %2$s', '1: Price, 2: Renewal date', 'stream'), esc_html($plan_amount), esc_html($expiry_date)); ?> <tr> <th><?php _e('Next Billing', 'stream'); ?> </th> <td><?php echo esc_html($next_billing_label); ?> </td> </tr> <?php } ?> <tr> <th><?php _e('Created', 'stream'); ?> </th> <td><?php echo esc_html($created_date); ?> </td> </tr> <tr> <th><?php _e('Site ID', 'stream'); ?> </th> <td> <code class="site-uuid"><?php echo esc_html(WP_Stream::$api->site_uuid); ?> </code> </td> </tr> <tr> <th><?php _e('API Key', 'stream'); ?> </th> <td> <code class="api-key"><?php echo esc_html(WP_Stream::$api->api_key); ?> </code> </td> </tr> </tbody> </table> </div> <div class="plan-actions submitbox"> <?php if ('free' === $plan_type) { ?> <a href="<?php echo esc_url(WP_Stream_Admin::account_url(sprintf('upgrade/?site_uuid=%s', WP_Stream::$api->site_uuid))); ?> " class="button button-primary button-large"><?php _e('Upgrade to Pro', 'stream'); ?> </a> <?php } else { ?> <a href="<?php echo esc_url(sprintf('%s/dashboard/?site_uuid=%s', self::PUBLIC_URL, WP_Stream::$api->site_uuid)); ?> " class="button button-primary button-large" target="_blank"><?php _e('Modify This Plan', 'stream'); ?> </a> <?php } ?> <a class="submitdelete disconnect" href="<?php echo esc_url(add_query_arg('disconnect', '1')); ?> "><?php _e('Disconnect', 'stream'); ?> </a> </div> <?php } ?> </div> </div> <?php }
public static function in_admin_header() { global $typenow; if (WP_Stream_Notifications_Post_Type::POSTTYPE !== $typenow) { return; } ?> <div class="stream-example"> <div class="stream-example-modal"> <h1><i class="dashicons dashicons-admin-comments"></i> <?php _e('Stream Notifications', 'stream'); ?> </h1> <p><?php _e('Get notified instantly when important changes are made on your site.', 'stream'); ?> </p> <ul> <li><i class="dashicons dashicons-yes"></i> <?php _e('Create notification rules quickly and easily', 'stream'); ?> </li> <li><i class="dashicons dashicons-yes"></i> <?php _e('Smart and powerful trigger matching', 'stream'); ?> </li> <li><i class="dashicons dashicons-yes"></i> <?php _e('Fully customized e-mail and SMS alerts', 'stream'); ?> </li> <li><i class="dashicons dashicons-yes"></i> <?php _e('Push alerts to your smartphone or tablet', 'stream'); ?> </li> </ul> <a href="<?php echo esc_url(WP_Stream_Admin::account_url(sprintf('upgrade?site_uuid=%s', WP_Stream::$api->site_uuid))); ?> " class="button button-primary button-large"><?php _e('Upgrade to Pro', 'stream'); ?> </a> </div> </div> <?php }