PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.1.1
Kubio AI Page Builder v2.1.1
2.9.1 2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / AI / admin-tab / tab.php
kubio / lib / AI / admin-tab Last commit date
partials 2 years ago tab.php 2 years ago
tab.php
70 lines
1 <?php
2
3 use IlluminateAgnostic\Arr\Support\Arr;
4 use Kubio\Core\Utils;
5 use Kubio\FileLog;
6 use Kubio\Flags;
7
8 add_filter(
9 'kubio/admin-page/info_page_tabs',
10 function( $tabs ) {
11 if ( ! Flags::getSetting( 'enableAICapabilities', false ) || ( Flags::getSetting( 'aiStage2' ) && kubio_is_free() ) ) {
12 return $tabs;
13 }
14
15 $tabs = array_merge(
16 $tabs,
17 array(
18 'ai-info' => array(
19 'type' => 'page',
20 'label' => __( 'Kubio AI', 'kubio' ),
21 'tab-partial' => __DIR__ . '/partials/main.php',
22 'subtitle' => __( 'Build smarter & faster with Kubio AI', 'kubio' ),
23 ),
24 )
25 );
26
27 if ( defined( 'KUBIO_AI_LOG' ) && KUBIO_AI_LOG ) {
28 $tabs = array_merge(
29 $tabs,
30 array(
31 'ai-logs' => array(
32 'type' => 'page',
33 'label' => 'Kubio AI Logs',
34 'tab-partial' => __DIR__ . '/partials/log.php',
35 'subtitle' => 'Kubio AI internal logs' . '<br/>' . sprintf( 'Cloud URL: %s', preg_replace( '#\?(.*)#', '', Utils::getCloudURL() ) ),
36 ),
37 )
38 );
39 }
40
41 return $tabs;
42 }
43 );
44
45 add_action(
46 'wp_ajax_kubio_clear_ai_logs',
47 function() {
48
49 $nonce = Arr::get( $_REQUEST, '_wpnonce', '' );
50 if ( ! wp_verify_nonce( $nonce, 'kubio_clear_ai_logs' ) ) {
51 wp_die(
52 __( 'Unauthorized', 'kubio' ),
53 __( 'Unauthorized', 'kubio' ),
54 array(
55 'response' => 401,
56 )
57 );
58 }
59
60 $logs_file = FileLog::get_log_files( 'AI' );
61
62 foreach ( $logs_file as $file ) {
63 unlink( $file );
64 }
65
66 wp_redirect( wp_get_referer() );
67 exit();
68 }
69 );
70