, Ruben Garcia * @since 2.0.0 */ // Exit if accessed directly if( !defined( 'ABSPATH' ) ) exit; /** * Dashboard page * * @since 2.0.0 */ function automatorwp_dashboard_page() { ?>


'latest-automations', 'title' => __( 'Latest Automations', 'automatorwp' ) . '' . esc_html__( 'View All', 'automatorwp' ) . '', 'content_cb' => 'automatorwp_dashboard_latest_automations_box', ) ); ?>
'most-completed-automations', 'title' => __( 'Most Completed Automations', 'automatorwp' ) . '' . esc_html__( 'View All', 'automatorwp' ) . '', 'content_cb' => 'automatorwp_dashboard_most_completed_automations_box', ) ); ?>
'latest-logs', 'title' => __( 'Latest Logs', 'automatorwp' ) . '' . esc_html__( 'View All', 'automatorwp' ) . '', 'content_cb' => 'automatorwp_dashboard_latest_logs_box', ) ); ?>
'new-automation', 'title' => __( 'New Automation', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_new_automation_box', ) ); ?>

'videos', 'title' => '', 'content_cb' => 'automatorwp_dashboard_videos_box', ) ); ?>

'docs', 'title' => __( 'Getting started', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_docs_box', ) ); ?>
'features', 'title' => __( 'Features', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_features_box', ) ); ?>
'advanced', 'title' => __( 'Advanced features', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_advanced_features_box', ) ); ?>
'support', 'title' => __( 'Support', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_support_box', ) ); ?>

'plugins', 'title' => __( 'Our Plugins', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_plugins_box', ) ); ?>
'team', 'title' => __( 'Meet the team', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_team_box', ) ); ?>
'involved', 'title' => __( 'Get involved', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_involved_box', ) ); ?>
'social', 'title' => __( 'Follow us', 'automatorwp' ), 'content_cb' => 'automatorwp_dashboard_social_box', ) ); ?>
'', 'title' => '', 'content' => '', 'content_cb' => '', ) ); ?>

info->slug; $thumbnail = 'https://automatorwp.com/wp-content/themes/automatorwp-theme/assets/img/integrations/' . $plugin->info->slug . '.svg'; $action_label = esc_html__( 'Get this add-on', 'automatorwp' ); ?>

info->excerpt ); ?>

title ) ? $automation->title : __( '(No title)', 'automatorwp' ); $title = '' . esc_html( $title ) . ''; $types = automatorwp_get_automation_types(); $type = ''; $type .= isset( $types[$automation->type] ) ? $types[$automation->type]['label'] : $automation->type; $type .= ''; $type_icon = ''; if( isset( $types[$automation->type] ) ) { $type_icon = '
' . esc_attr( $types[$automation->type]['label'] ) . ' ' . esc_html( $types[$automation->type]['label'] ) . '
'; } $completions = ct_get_object_meta( $automation->id, 'completions', true ); if( empty( $completions ) ) { $completions = automatorwp_get_object_completion_times( $automation->id, 'automation' ); ct_update_object_meta( $automation->id, 'completions', $completions ); } $completions = absint( $completions ); $times = absint( $automation->times ); if( $times !== 0 ) { $completions = $completions . '/' . $times; } $completions = '' . $completions . '' . esc_html__( 'Completions', 'automatorwp' ) . '' . ''; $statuses = automatorwp_get_automation_statuses(); $status = isset( $statuses[$automation->status] ) ? $statuses[$automation->status] : esc_html( $automation->status ); $status = '' . $status . ''; $time = strtotime( $automation->date ); $today = date( 'Y-m-d', current_time( 'timestamp' ) ); $yesterday = date( 'Y-m-d', strtotime( '-1 day', current_time( 'timestamp' ) ) ); if ( date( 'Y-m-d', $time ) === $today ) { $relative = __( 'Today', 'automatorwp' ); } elseif ( date( 'Y-m-d', $time ) === $yesterday ) { $relative = __( 'Yesterday', 'automatorwp' ); } elseif ( date( 'Y', $time ) !== date( 'Y', current_time( 'timestamp' ) ) ) { /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */ $relative = date_i18n( __( 'M jS Y' ), $time ); } else { /* translators: date and time format for recent posts on the dashboard, see https://secure.php.net/date */ $relative = date_i18n( __( 'M jS' ), $time ); } $date = sprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, mysql2date( get_option( 'time_format' ), $automation->date ) ); echo '
  • ' . '
    ' . '' .$type_icon . '' . '
    ' . '
    ' . '' . $title . '' . '' . $completions . '' . '
    ' . '
    ' . '' . $status . '' . '' . $date . '' . '
    ' . '
  • '; } /** * Dashboard latest automations box * * @since 2.0.0 */ function automatorwp_dashboard_latest_automations_box() { // Setup table ct_setup_table( 'automatorwp_automations' ); $query = new CT_Query( array( 'orderby' => 'date', 'order' => 'DESC', 'items_per_page' => 5, 'no_found_rows' => true, 'cache_results' => false, ) ); $automations = $query->get_results(); if ( count( $automations ) > 0 ) { echo '
    '; echo ''; echo '
    '; } else { echo '

    ' . __( 'Nothing to show :)', 'automatorwp' ) .'

    '; } } /** * Dashboard most completed automations box * * @since 2.0.0 */ function automatorwp_dashboard_most_completed_automations_box() { global $wpdb, $ct_table; // Setup table $automations_table = AutomatorWP()->db->automations; $automations_meta_table = AutomatorWP()->db->automations_meta; $automations = $wpdb->get_results( "SELECT a.* FROM {$automations_table} AS a LEFT JOIN {$automations_meta_table} AS am ON ( am.id = a.id AND am.meta_key = 'completions' ) ORDER BY CAST( am.meta_value AS UNSIGNED ) DESC LIMIT 5" ); ct_setup_table( 'automatorwp_automations' ); if ( count( $automations ) > 0 ) { echo '
    '; echo ''; echo '
    '; } else { echo '

    ' . __( 'Nothing to show :)', 'automatorwp' ) .'

    '; } } /** * Dashboard latest logs box * * @since 2.0.0 */ function automatorwp_dashboard_latest_logs_box() { // Setup table ct_setup_table( 'automatorwp_logs' ); $query = new CT_Query( array( 'orderby' => 'id', 'order' => 'DESC', 'items_per_page' => 5, 'no_found_rows' => true, 'cache_results' => false, ) ); $logs = $query->get_results(); if ( count( $logs ) > 0 ) { echo '
    '; echo ''; echo '
    '; } else { echo '

    ' . __( 'Nothing to show :)', 'automatorwp' ) .'

    '; } } /** * Dashboard new automation box * * @since 2.0.0 */ function automatorwp_dashboard_new_automation_box() { $types = automatorwp_get_automation_types(); ?>
    $args ) : if( in_array( $type, automatorwp_get_automation_loop_types() ) ) continue; ?>
    <?php echo $args['label']; ?>

    group of elements. Can be run manually, on a specific date or on a recurring basis.', 'automatorwp' ); ?>

    $args ) : if( ! in_array( $type, automatorwp_get_automation_loop_types() ) ) continue; ?>
    <?php echo $args['label']; ?>
    info->slug, $add_ons_to_display ) ) { $add_ons[] = $plugin; } if( in_array( $plugin->info->slug, $add_ons_to_display_2 ) ) { $add_ons_2[] = $plugin; } } ?>

    info->slug, $add_ons_to_display ) ) { $add_ons[] = $plugin; } if( in_array( $plugin->info->slug, $add_ons_to_display_2 ) ) { $add_ons_2[] = $plugin; } } ?>

    info->slug, $add_ons_to_display ) ) { $add_ons[] = $plugin; } if( in_array( $plugin->info->slug, $add_ons_to_display_2 ) ) { $add_ons_2[] = $plugin; } } ?>

    'vWqRcEO8SgY', 'title' => 'Creating your first automation on WordPress', 'duration' => '1:53', ), array( 'id' => 'bDXtY386RpE', 'title' => 'Connect your WordPress plugins with Google Sheets', 'duration' => '3:01', ), array( 'id' => 'JHCWVbLqR0A', 'title' => 'Give access to site B when a purchase is made on site A (WooCommerce & LifterLMS)', 'duration' => '4:32', ), array( 'id' => 'EkoEmKsSHMo', 'title' => 'Run automations through Youtube videos', 'duration' => '1:55', ), array( 'id' => 'sZfYK6jtGg0', 'title' => 'Run automations through Vimeo videos', 'duration' => '2:06', ), ); foreach( $videos as $video ) { ?>
    '3YMMQ6QqrDo', 'title' => 'Connect automations from different sites through Webhooks', 'duration' => '2:55', ), array( 'id' => 'Nk--kqIkC9Y', 'title' => 'Schedule actions of an automation', 'duration' => '2:11', ), array( 'id' => '75PhOiqZRys', 'title' => 'Run automations through button clicks', 'duration' => '2:24', ), array( 'id' => 'yTfygkAG4Lk', 'title' => 'Run automations through link clicks', 'duration' => '2:17', ), array( 'id' => '2Tw3HIqvQuk', 'title' => 'Connect your WordPress plugins with BuddyBoss', 'duration' => '1:58', ), ); foreach( $videos as $video ) { ?>