From 53a3a39b1783075224f1d0fc6410df7ec7fe9d3b Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Mon, 2 Feb 2026 18:07:35 +0600 Subject: [PATCH 1/4] User account Profile page --- classes/Dashboard.php | 2 - classes/Utils.php | 4 +- templates/dashboard/account/profile.php | 4 + .../instructor/profile-statistics.php | 35 ++++++ templates/user-profile.php | 113 ++++++++++++++++++ 5 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 templates/dashboard/instructor/profile-statistics.php create mode 100644 templates/user-profile.php diff --git a/classes/Dashboard.php b/classes/Dashboard.php index a1040339c5..96112a7146 100644 --- a/classes/Dashboard.php +++ b/classes/Dashboard.php @@ -10,8 +10,6 @@ namespace TUTOR; -use Tutor\Helpers\UrlHelper; - if ( ! defined( 'ABSPATH' ) ) { exit; } diff --git a/classes/Utils.php b/classes/Utils.php index 08ac972d96..2a9abf450e 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -14,13 +14,13 @@ use Tutor\Ecommerce\Tax; use Tutor\Cache\TutorCache; use Tutor\Models\QuizModel; +use Tutor\Helpers\UrlHelper; use Tutor\Helpers\HttpHelper; use Tutor\Models\CourseModel; use Tutor\Ecommerce\Ecommerce; use Tutor\Helpers\QueryHelper; use Tutor\Traits\JsonResponse; use Tutor\Helpers\DateTimeHelper; -use Tutor\Helpers\UrlHelper; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -8545,7 +8545,7 @@ public function is_tutor_dashboard( $subpage = null ) { * * @return boolean */ - public function is_tutor_frontend_dashboard( $subpage = null ) { + public function is_tutor_frontend_dashboard( $subpage = '' ) { global $wp_query; if ( $wp_query->is_page ) { $dashboard_page = $this->array_get( 'tutor_dashboard_page', $wp_query->query_vars ); diff --git a/templates/dashboard/account/profile.php b/templates/dashboard/account/profile.php index fd1c23063c..43015e53ab 100644 --- a/templates/dashboard/account/profile.php +++ b/templates/dashboard/account/profile.php @@ -10,6 +10,9 @@ */ defined( 'ABSPATH' ) || exit; + +use TUTOR\User; + ?>
@@ -17,6 +20,7 @@
+ true ) ); ?>
diff --git a/templates/dashboard/instructor/profile-statistics.php b/templates/dashboard/instructor/profile-statistics.php new file mode 100644 index 0000000000..a831aea9b3 --- /dev/null +++ b/templates/dashboard/instructor/profile-statistics.php @@ -0,0 +1,35 @@ + + * @link https://themeum.com + * @since 4.0.0 + */ + +use TUTOR\Icon; +?> + +
+ +
+ + +
+
+ render_svg_icon( + $stat['icon'], + 24, + 24, + array( 'class' => $stat['icon_class'] ) + ); + ?> +
+
+

+
+
+
+ diff --git a/templates/user-profile.php b/templates/user-profile.php new file mode 100644 index 0000000000..5151b408b2 --- /dev/null +++ b/templates/user-profile.php @@ -0,0 +1,113 @@ + + * @link https://themeum.com + * @since 4.0.0 + */ + +use TUTOR\Icon; +use TUTOR\User; +use Tutor\Models\CourseModel; +use Tutor\Models\WithdrawModel; + +$user = wp_get_current_user(); +$student_details = get_userdata( $user->ID ); +$student_meta = get_user_meta( $user->ID ); +$edit_profile_url = tutor_utils()->tutor_dashboard_url( 'account/settings' ); + +$statistics = array( + array( + 'value' => WithdrawModel::get_withdraw_summary( $user->ID )->total_income ?? 0, + 'icon' => Icon::EARNING, + 'label' => __( 'Total Earnings', 'tutor' ), + 'icon_class' => 'tutor-actions-success-primary', + ), + array( + 'value' => CourseModel::get_course_count_by_instructor( $user->ID ), + 'icon' => Icon::COURSES_FILL, + 'label' => __( 'Total Courses', 'tutor' ), + 'icon_class' => 'tutor-icon-brand', + ), + array( + 'value' => tutor_utils()->get_instructor_ratings( $user->ID )->rating_avg ?? 0, + 'icon' => Icon::STAR_FILL, + 'label' => __( 'Ratings', 'tutor' ), + 'icon_class' => 'tutor-text-exception4', + ), + array( + 'value' => tutor_utils()->get_total_students_by_instructor( $user->ID ) ?? 0, + 'icon' => Icon::PASSED, + 'label' => __( 'Total Students', 'tutor' ), + 'icon_class' => 'tutor-text-exception5', + ), +); +?> +
+
+
+ +
+ +
+ + +
+
+ render_svg_icon( Icon::MEMBER ); ?> + + user_registered, 'F j, Y' ) ); ?> +
+
+
+ + + + +
+
From 3eddf03f18c9be82ed65802130661ce204232d67 Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Tue, 3 Feb 2026 10:56:52 +0600 Subject: [PATCH 2/4] New icons for user profile --- assets/icons/earning-fill.svg | 5 +++++ assets/icons/passed-fill.svg | 5 +++++ assets/src/js/v3/shared/icons/types.ts | 2 ++ classes/Icon.php | 2 ++ .../dashboard/instructor/profile-statistics.php | 17 ++++++++++------- templates/user-profile.php | 4 ++-- 6 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 assets/icons/earning-fill.svg create mode 100644 assets/icons/passed-fill.svg diff --git a/assets/icons/earning-fill.svg b/assets/icons/earning-fill.svg new file mode 100644 index 0000000000..2e6f69614b --- /dev/null +++ b/assets/icons/earning-fill.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/passed-fill.svg b/assets/icons/passed-fill.svg new file mode 100644 index 0000000000..981f4ff733 --- /dev/null +++ b/assets/icons/passed-fill.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/src/js/v3/shared/icons/types.ts b/assets/src/js/v3/shared/icons/types.ts index f02cdfbeb0..b8e1525ca0 100644 --- a/assets/src/js/v3/shared/icons/types.ts +++ b/assets/src/js/v3/shared/icons/types.ts @@ -127,6 +127,7 @@ export const icons = [ 'duplicate', 'dwg', 'earning', + 'earningFill', 'edit', 'edit2', 'elementorColorized', @@ -239,6 +240,7 @@ export const icons = [ 'open', 'outlineNone', 'passed', + 'passedFill', 'passing', 'pauseCircle', 'pdf', diff --git a/classes/Icon.php b/classes/Icon.php index 0cf785ebb3..7877c1d88d 100644 --- a/classes/Icon.php +++ b/classes/Icon.php @@ -143,6 +143,7 @@ final class Icon { const DUPLICATE = 'duplicate'; const DWG = 'dwg'; const EARNING = 'earning'; + const EARNING_FILL = 'earning-fill'; const EDIT = 'edit'; const EDIT_2 = 'edit-2'; const ELEMENTOR_COLORIZED = 'elementor-colorized'; @@ -255,6 +256,7 @@ final class Icon { const OPEN = 'open'; const OUTLINE_NONE = 'outline-none'; const PASSED = 'passed'; + const PASSED_FILL = 'passed-fill'; const PASSING = 'passing'; const PAUSE_CIRCLE = 'pause-circle'; const PDF = 'pdf'; diff --git a/templates/dashboard/instructor/profile-statistics.php b/templates/dashboard/instructor/profile-statistics.php index a831aea9b3..5b302e3667 100644 --- a/templates/dashboard/instructor/profile-statistics.php +++ b/templates/dashboard/instructor/profile-statistics.php @@ -15,9 +15,11 @@ - +
-
+ +
+
render_svg_icon( $stat['icon'], @@ -26,10 +28,11 @@ array( 'class' => $stat['icon_class'] ) ); ?> +
+
+

+
+
-
-

-
-
+
- diff --git a/templates/user-profile.php b/templates/user-profile.php index 5151b408b2..3fa3a41183 100644 --- a/templates/user-profile.php +++ b/templates/user-profile.php @@ -21,7 +21,7 @@ $statistics = array( array( 'value' => WithdrawModel::get_withdraw_summary( $user->ID )->total_income ?? 0, - 'icon' => Icon::EARNING, + 'icon' => Icon::EARNING_FILL, 'label' => __( 'Total Earnings', 'tutor' ), 'icon_class' => 'tutor-actions-success-primary', ), @@ -39,7 +39,7 @@ ), array( 'value' => tutor_utils()->get_total_students_by_instructor( $user->ID ) ?? 0, - 'icon' => Icon::PASSED, + 'icon' => Icon::PASSED_FILL, 'label' => __( 'Total Students', 'tutor' ), 'icon_class' => 'tutor-text-exception5', ), From dc6632992496a767ffde7389d8a9bf1af226fadb Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Tue, 3 Feb 2026 11:00:36 +0600 Subject: [PATCH 3/4] statistics show/hide for user profile --- templates/dashboard/account/profile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/dashboard/account/profile.php b/templates/dashboard/account/profile.php index 43015e53ab..a5929701f8 100644 --- a/templates/dashboard/account/profile.php +++ b/templates/dashboard/account/profile.php @@ -13,6 +13,8 @@ use TUTOR\User; +$show_statistics = User::is_instructor() ? true : false; + ?>
@@ -20,7 +22,7 @@
- true ) ); ?> + $show_statistics ) ); ?>
From 969a4c536ba6920850f170847eb749b8f0443d7e Mon Sep 17 00:00:00 2001 From: sanjana4khan Date: Tue, 3 Feb 2026 16:30:15 +0600 Subject: [PATCH 4/4] code formate --- templates/dashboard/account/profile.php | 46 +++++++- templates/user-profile.php | 138 +++++++++--------------- 2 files changed, 95 insertions(+), 89 deletions(-) diff --git a/templates/dashboard/account/profile.php b/templates/dashboard/account/profile.php index a5929701f8..728a234ec6 100644 --- a/templates/dashboard/account/profile.php +++ b/templates/dashboard/account/profile.php @@ -11,10 +11,43 @@ defined( 'ABSPATH' ) || exit; +use TUTOR\Icon; use TUTOR\User; +use Tutor\Models\CourseModel; +use Tutor\Models\WithdrawModel; +$statistics = array(); +$user = wp_get_current_user(); $show_statistics = User::is_instructor() ? true : false; +if ( $show_statistics ) { + $statistics = array( + array( + 'value' => WithdrawModel::get_withdraw_summary( $user->ID )->total_income ?? 0, + 'icon' => Icon::EARNING_FILL, + 'label' => __( 'Total Earnings', 'tutor' ), + 'icon_class' => 'tutor-actions-success-primary', + ), + array( + 'value' => CourseModel::get_course_count_by_instructor( $user->ID ), + 'icon' => Icon::COURSES_FILL, + 'label' => __( 'Total Courses', 'tutor' ), + 'icon_class' => 'tutor-icon-brand', + ), + array( + 'value' => tutor_utils()->get_instructor_ratings( $user->ID )->rating_avg ?? 0, + 'icon' => Icon::STAR_FILL, + 'label' => __( 'Ratings', 'tutor' ), + 'icon_class' => 'tutor-text-exception4', + ), + array( + 'value' => tutor_utils()->get_total_students_by_instructor( $user->ID ) ?? 0, + 'icon' => Icon::PASSED_FILL, + 'label' => __( 'Total Students', 'tutor' ), + 'icon_class' => 'tutor-text-exception5', + ), + ); +} ?>
@@ -22,7 +55,18 @@
- $show_statistics ) ); ?> +
diff --git a/templates/user-profile.php b/templates/user-profile.php index 3fa3a41183..5eaf73a576 100644 --- a/templates/user-profile.php +++ b/templates/user-profile.php @@ -10,104 +10,66 @@ use TUTOR\Icon; use TUTOR\User; -use Tutor\Models\CourseModel; -use Tutor\Models\WithdrawModel; $user = wp_get_current_user(); $student_details = get_userdata( $user->ID ); $student_meta = get_user_meta( $user->ID ); $edit_profile_url = tutor_utils()->tutor_dashboard_url( 'account/settings' ); - -$statistics = array( - array( - 'value' => WithdrawModel::get_withdraw_summary( $user->ID )->total_income ?? 0, - 'icon' => Icon::EARNING_FILL, - 'label' => __( 'Total Earnings', 'tutor' ), - 'icon_class' => 'tutor-actions-success-primary', - ), - array( - 'value' => CourseModel::get_course_count_by_instructor( $user->ID ), - 'icon' => Icon::COURSES_FILL, - 'label' => __( 'Total Courses', 'tutor' ), - 'icon_class' => 'tutor-icon-brand', - ), - array( - 'value' => tutor_utils()->get_instructor_ratings( $user->ID )->rating_avg ?? 0, - 'icon' => Icon::STAR_FILL, - 'label' => __( 'Ratings', 'tutor' ), - 'icon_class' => 'tutor-text-exception4', - ), - array( - 'value' => tutor_utils()->get_total_students_by_instructor( $user->ID ) ?? 0, - 'icon' => Icon::PASSED_FILL, - 'label' => __( 'Total Students', 'tutor' ), - 'icon_class' => 'tutor-text-exception5', - ), -); ?> -