Skip to content

Commit

Permalink
Merge pull request #28 from kprajapatii/master
Browse files Browse the repository at this point in the history
pre-release test
  • Loading branch information
kprajapatii authored Jul 2, 2024
2 parents f4f97a5 + 35584f6 commit 3b0349b
Show file tree
Hide file tree
Showing 6 changed files with 872 additions and 376 deletions.
32 changes: 29 additions & 3 deletions includes/class-ayecode-connect-remote-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public function import_page_template( $page_template, $type = '', $cpt = '' ) {
$post_id = 0;

if ( ! empty( $page_template['post_title'] ) ) {
//$this->debug_log( $page_template['post_title'], __METHOD__ . ':' . $type, __FILE__, __LINE__ );
$this->debug_log( $page_template['post_title'], __METHOD__ . ':' . $type, __FILE__, __LINE__ );
}

if ( $type == 'elementor' ) {
Expand Down Expand Up @@ -1841,7 +1841,7 @@ public function install_theme( $result ) {
)
);

$this->debug_log( $api, __METHOD__ . . ':' . $slug . ':themes_api', __FILE__, __LINE__ );
$this->debug_log( $api, __METHOD__ . ':' . $slug . ':themes_api', __FILE__, __LINE__ );

if ( is_wp_error( $api ) ) {
$this->debug_log( $api->get_error_message(), __METHOD__ . ':themes_api error', __FILE__, __LINE__ );
Expand Down Expand Up @@ -2583,6 +2583,12 @@ public function str_replace_args( $values = false ) {
}

public function debug_log( $log, $title = '', $file = '', $line = '', $exit = false ) {
global $aye_usage;

if ( empty( $aye_usage ) ) {
$aye_usage = array();
}

$should_log = $this->debug;

if ( defined( 'AYECODE_CONNECT_DEBUG' ) ) {
Expand All @@ -2606,7 +2612,27 @@ public function debug_log( $log, $title = '', $file = '', $line = '', $exit = fa

$append = '';
if ( is_scalar( $log ) && ( $log === 'start' || $log === 'end' ) ) {
$append = " " . memory_get_usage();
$usage = memory_get_usage();

$append = " " . $usage;

$_label = '';

if ( $file && $file !== '' ) {
$_label .= basename( $file ) . ':';
}

if ( $title && $title !== '' ) {
$_label .= $title;
}

if ( $_label ) {
$aye_usage[ $_label ][ $log ] = $usage;

if ( $log === 'end' && ! empty( $aye_usage[ $_label ][ 'start' ] ) ) {
$append .= " - " . ( $usage - $aye_usage[ $_label ][ 'start' ] );
}
}
}

if ( is_array( $log ) || is_object( $log ) ) {
Expand Down
30 changes: 28 additions & 2 deletions includes/class-ayecode-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,12 @@ public function request_demo_content( $demo, $type, $page = 0 ) {
}

public function debug_log( $log, $title = '', $file = '', $line = '', $exit = false ) {
global $aye_usage;

if ( empty( $aye_usage ) ) {
$aye_usage = array();
}

$should_log = $this->debug;

if ( defined( 'AYECODE_CONNECT_DEBUG' ) ) {
Expand All @@ -1930,8 +1936,28 @@ public function debug_log( $log, $title = '', $file = '', $line = '', $exit = fa
$label = $label !== '' ? trim( $label ) . ' : ' : '';

$append = '';
if ( is_scalar( $log ) && ( $log == 'start' || $log == 'end' ) ) {
$append = " " . memory_get_usage();
if ( is_scalar( $log ) && ( $log === 'start' || $log === 'end' ) ) {
$usage = memory_get_usage();

$append = " " . $usage;

$_label = '';

if ( $file && $file !== '' ) {
$_label .= basename( $file ) . ':';
}

if ( $title && $title !== '' ) {
$_label .= $title;
}

if ( $_label ) {
$aye_usage[ $_label ][ $log ] = $usage;

if ( $log === 'end' && ! empty( $aye_usage[ $_label ][ 'start' ] ) ) {
$append .= " - " . ( $usage - $aye_usage[ $_label ][ 'start' ] );
}
}
}

if ( is_array( $log ) || is_object( $log ) ) {
Expand Down
62 changes: 44 additions & 18 deletions includes/class-ayecode-demo-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,13 @@ public function get_demo_tabs_body( $sites )

}

public function get_demo_tabs_head($sites)
{
public function get_demo_tabs_head( $sites ) {
global $aui_bs5;

$types = $this->get_demo_site_types($sites);
ob_start();

echo '<ul class="nav nav-tabs mb-3" id="ayecode-connect-demo-tabs" role="tablist">';
echo '<ul class="nav nav-tabs mb-4" id="ayecode-connect-demo-tabs" role="tablist">';

$names = array(
'blockstrap' => 'BlockStrap',
Expand All @@ -630,23 +630,23 @@ public function get_demo_tabs_head($sites)
'legacy' => 'legacy',
);

foreach ( $types as $type => $sites ){
if (!empty($sites)) {
$active = 'blockstrap'==$type ? 'active' : '';
$selected = 'blockstrap' == $type ? 'true' : 'false';

foreach ( $types as $type => $sites ) {
if ( ! empty( $sites ) ) {
$active = 'blockstrap' == $type ? 'active' : '';
$selected = 'blockstrap' == $type ? 'true' : 'false';

echo '<li class="nav-item mb-0" role="presentation">';
echo '<button class="nav-link ' . esc_attr( $active ) . '" id="ayecode-demo-' . esc_attr( $type ) . '" data-' . ( $aui_bs5 ? 'bs-' : '' ) . 'toggle="pill" data-' . ( $aui_bs5 ? 'bs-' : '' ) . 'target="#ayecode-demo-' . esc_attr( $type ) . '-pane" type="button" role="tab" aria-controls="pills-home" aria-selected="' . esc_attr( $selected ) . '">';

echo '<li class="nav-item" role="presentation">';
echo '<button class="nav-link '.esc_attr($active).'" id="ayecode-demo-'.esc_attr($type).'" data-bs-toggle="pill" data-bs-target="#ayecode-demo-'.esc_attr($type).'-pane" type="button" role="tab" aria-controls="pills-home" aria-selected="'.esc_attr($selected).'">';
if('kadence'===$type) {
echo '<img width="22px" src = "'.$this->base_url .'assets/img/kadencewp-icon-dark.svg" alt="Kadence WP"/>';
}elseif('elementor'===$type) {
echo '<i style="color:#db3157;font-size: 22px;float: left;margin-bottom: -6px;padding-top: 1px;" class="fab fa-elementor me-1" ></i>';
}elseif('blockstrap'===$type) {
echo '<img width="22px" class="me-1" src = "'.$this->base_url .'assets/img/blockstrap-logo.jpg" alt="BlockStrap"/>';
if ( 'kadence' === $type ) {
echo '<img width="22px" class="me-1 mr-1" src="' . $this->base_url . 'assets/img/kadencewp-icon-dark.svg" alt="Kadence WP"/>';
} else if ( 'elementor' === $type ) {
echo '<i style="color:#db3157;font-size:22px" class="fab fa-elementor me-1 mr-1" ></i>';
} else if ( 'blockstrap' === $type ) {
echo '<img width="22px" class="me-1 mr-1" src = "' . $this->base_url . 'assets/img/blockstrap-logo.jpg" alt="BlockStrap"/>';
}
echo esc_html($names[$type]);

echo esc_html( $names[ $type ] );
echo '</button>';
echo '</li>';
}
Expand Down Expand Up @@ -1585,6 +1585,12 @@ public function set_menus( $demo_file, $demo ) {
}

public function debug_log( $log, $title = '', $file = '', $line = '', $exit = false ) {
global $aye_usage;

if ( empty( $aye_usage ) ) {
$aye_usage = array();
}

$should_log = $this->debug;

if ( defined( 'AYECODE_CONNECT_DEBUG' ) ) {
Expand All @@ -1608,7 +1614,27 @@ public function debug_log( $log, $title = '', $file = '', $line = '', $exit = fa

$append = '';
if ( is_scalar( $log ) && ( $log === 'start' || $log === 'end' ) ) {
$append = " " . memory_get_usage();
$usage = memory_get_usage();

$append = " " . $usage;

$_label = '';

if ( $file && $file !== '' ) {
$_label .= basename( $file ) . ':';
}

if ( $title && $title !== '' ) {
$_label .= $title;
}

if ( $_label ) {
$aye_usage[ $_label ][ $log ] = $usage;

if ( $log === 'end' && ! empty( $aye_usage[ $_label ][ 'start' ] ) ) {
$append .= " - " . ( $usage - $aye_usage[ $_label ][ 'start' ] );
}
}
}

if ( is_array( $log ) || is_object( $log ) ) {
Expand Down
Binary file modified languages/ayecode-connect-en_US.mo
Binary file not shown.
Loading

0 comments on commit 3b0349b

Please sign in to comment.