Skip to content

Conversation

@sanjana4khan
Copy link
Collaborator

No description provided.

@sanjana4khan sanjana4khan added the 4.0.0 Tutor v4.w0w label Jan 21, 2026
*/

namespace TUTOR;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use direct access prevention code here
defined( 'ABSPATH' ) || exit;


$diff = ! empty( $start_date ) && ! empty( $end_date ) ? $current_data - $previous_data : $previous_data;
$symbol = $diff < 0 ? '-' : ( $diff > 0 ? '+' : '' );
$diff = $price ? wp_kses_post( tutor_utils()->tutor_price( abs( $diff ) ) ) : abs( $diff );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not rendering here, why need wp_kses_post


$time_zone = wp_timezone();
$now = new DateTime( 'now', $time_zone );
$today = wp_date( 'Y-m-d', null, $time_zone );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use DateTimeHelper

$format    = DateTimeHelper::FORMAT_DATE;
$now       = DateTimeHelper::now()->set_timezone( wp_timezone() );

$today            = $now->format( $format );
$this_month_start = $now->create( 'first day of this month' )->format( $format );
$this_month_end   = $now->create( 'last day of this month' )->format( $format );
...
...

public static function get_comparison_date_range( $selected_start_date, $selected_end_date ) {

if ( empty( $selected_start_date ) && empty( $selected_end_date ) ) {
$now = new DateTime();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use DateTimeHelper

* @return string|null Returns the SVG markup when `$return` is true, otherwise null.
*/
public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array() ) {
public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array(), $return = false ): ?string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is named for direct rendering. Use buffer to get string or make get_svg_icon method and use it inside render_svg_icon

}
}

// $upcoming_tasks = array(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dummy data code

</div>
<?php
$i++;
++$i;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

* @link https://themeum.com
* @since 1.4.3
*/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent direct access defined( 'ABSPATH' ) || exit;

* @link https://themeum.com
* @since 4.0.0
*/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this file change?


use TUTOR\Icon;
/**
* Star Rating Component
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this file change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants