crawler->is_empty(); $primary = ''; $secondary = '
'; $cmb->add_field([ 'id' => 'console_authorization_code', 'type' => 'text', 'name' => esc_html__( 'Search Console', 'rank-math' ), 'desc' => esc_html__( 'Authorize the plugin to access data from Google Search Console.', 'rank-math' ), 'attributes' => [ 'data-authorized' => $data['authorized'] ? 'true' : 'false' ], 'after_field' => $primary . $secondary, ]); $profile = Helper::get_settings( 'general.console_profile' ); $profile_label = str_replace( 'sc-domain:', __( 'Domain Property: ', 'rank-math' ), $profile ); foreach ( $data['profiles'] as $key => $value ) { $data['profiles'][ $key ] = str_replace( 'sc-domain:', __( 'Domain Property: ', 'rank-math' ), $value ); } $cmb->add_field([ 'id' => 'console_profile', 'type' => 'select', 'name' => esc_html__( 'Search Console Profile', 'rank-math' ), 'desc' => esc_html__( 'After authenticating with Google Search Console, select the site from the dropdown list.', 'rank-math' ) . ' ' . /* translators: setting url */ '

' . sprintf( __( 'Is your site not listed? Click here to get your website verified.', 'rank-math' ), Helper::get_admin_url( 'options-general#setting-panel-webmaster' ) ) . '', 'options' => $profile ? [ $profile => $profile_label ] : $data['profiles'], 'default' => $profile, 'after_field' => '', 'attributes' => $data['authorized'] ? [ 'data-s2' => '' ] : [ 'disabled' => 'disabled', 'data-s2' => '', ], ]); if ( $is_empty ) { $cmb->add_field([ 'id' => 'console_data_empty', 'type' => 'notice', 'what' => 'error', /* translators: date */ 'content' => sprintf( __( 'The data sets are empty in your cache. You can wait for the next cronjob (%s) or Update Manually.', 'rank-math' ), date( 'd/m/Y 00:00:00', strtotime( '+1 days' ) ) ) . '

' . __( 'Note: Please update your data by clicking on \'Update Manually\'. Google only stores data from the last 90 days - a dataset older than that can\'t be updated anymore.', 'rank-math' ) . '

', ]); } $disable = ( ! $data['authorized'] || ! $is_queue_empty ) ? true : false; $cmb->add_field([ 'id' => 'console_caching_control', 'type' => 'text', 'name' => __( 'Cache Limit
Days to keep data rows in cache', 'rank-math' ), 'default' => 90, 'after_field' => '
' . '' . '  ' . '  
' . /* translators: number of days */ '
' . sprintf( esc_html__( 'Cached Days: %s', 'rank-math' ), '' . $db_info['days'] . '' ) . '
' . /* translators: number of rows */ '
' . sprintf( esc_html__( 'Data Rows: %s', 'rank-math' ), '' . Str::human_number( $db_info['rows'] ) . '' ) . '
' . /* translators: database size */ '
' . sprintf( esc_html__( 'Size: %s', 'rank-math' ), '' . size_format( $db_info['size'] ) . '' ) . '
', ]);