les( array( 'dimensions' => $dimensions_block_styles ) );
if ( ! empty( $styles['css'] ) ) {
// Inject dimensions styles to the first element, presuming it's the wrapper, if it exists.
$tags = new WP_HTML_Tag_Processor( $block_content );
if ( $tags->next_tag() ) {
$existing_style = $tags->get_attribute( 'style' );
$updated_style = '';
if ( ! empty( $existing_style ) ) {
$updated_style = $existing_style;
if ( ! str_ends_with( $existing_style, ';' ) ) {
$updated_style .= ';';
}
}
$updated_style .= $styles['css'];
$tags->set_attribute( 'style', $updated_style );
if ( ! empty( $styles['classnames'] ) ) {
foreach ( explode( ' ', $styles['classnames'] ) as $class_name ) {
if (
str_contains( $class_name, 'aspect-ratio' ) &&
! isset( $block_attributes['style']['dimensions']['aspectRatio'] )
) {
continue;
}
$tags->add_class( $class_name );
}
}
}
return $tags->get_updated_html();
}
return $block_content;
}
add_filter( 'render_block', 'wp_render_dimensions_support', 10, 2 );
// Register the block support.
WP_Block_Supports::get_instance()->register(
'dimensions',
array(
'register_attribute' => 'wp_register_dimensions_support',
'apply' => 'wp_apply_dimensions_support',
)
);
se = $this->controller->can_scan();
$can_scan_response_code = wp_remote_retrieve_response_code( $can_scan_response );
if ( 200 === $can_scan_response_code ) {
$can_scan_response = json_decode( wp_remote_retrieve_body( $can_scan_response ), true );
if ( ! $can_scan_response['canScan'] ) {
return new WP_Error( 'cky_rest_scan_initiated', __( 'Could not initiate the scan, please try again', 'cookie-law-info' ), array( 'status' => 200 ) );
}
}
$response = $this->controller->initiate_scan();
$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 === $response_code || 400 === $response_code ) {
$response = json_decode( wp_remote_retrieve_body( $response ), true );
if ( 200 === $response_code ) {
$this->controller->update_info(
array(
'status' => 'initiated',
'date' => isset( $response['created_at'] ) ? $response['created_at'] : '',
'type' => isset( $response['type'] ) ? $response['type'] : '',
'id' => isset( $response['id'] ) ? $response['id'] : '',
)
);
return $response;
} else {
$this->controller->update_info(
array(
'status' => 'initiated',
)
);
return rest_ensure_response( $this->controller->get_info() );
}
} else {
return new WP_Error( 'cky_rest_scan_initiated', __( 'Could not initiate the scan, please try again', 'cookie-law-info' ), array( 'status' => 200 ) );
}
return json_decode( wp_remote_retrieve_body( $response ), true );
}
/**
* Format data
*
* @param object $object Item data.
* @return void
*/
protected function get_formatted_item_data( $object ) {
$data = $object->get_data();
}
/**
* Get the Cookies's schema, conforming to JSON Schema.
*
* @return array
*/
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'cookie_categories',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the resource.', 'cookie-law-info' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'date_created' => array(
'description' => __( 'The date the cookie was created, as GMT.', 'cookie-law-info' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_modified' => array(
'description' => __( 'The date the cookie was last modified, as GMT.', 'cookie-law-info' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'name' => array(
'description' => __( 'Cookie category name.', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'slug' => array(
'description' => __( 'Cookie category unique name', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'description' => array(
'description' => __( 'Cookie category description.', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'default_state' => array(
'description' => __( 'Cookie type.', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'head_scripts' => array(
'description' => __( 'Cookie scripts.', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'body_scripts' => array(
'description' => __( 'Cookie scripts.', 'cookie-law-info' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'cookies' => array(
'description' => __( 'Cookie count.', 'cookie-law-info' ),
'type' => 'integer',
'context' => array( 'view' ),
),
),
);
return $this->add_additional_fields_schema( $schema );
}
} // End the class.
Fatal error: Uncaught Error: Class 'CookieYes\Lite\Admin\Modules\Scanner\Api\Api' not found in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/scanner/class-scanner.php:40
Stack trace:
#0 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/scanner/class-scanner.php(29): CookieYes\Lite\Admin\Modules\Scanner\Scanner->load_apis(Object(CookieYes\Lite\Admin\Modules\Scanner\Includes\Controller))
#1 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/includes/class-modules.php(54): CookieYes\Lite\Admin\Modules\Scanner\Scanner->init()
#2 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/class-admin.php(179): CookieYes\Lite\Includes\Modules->__construct('scanner')
#3 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/class-admin.php(81): CookieYes\Lite\Admin\Admin->load_modules()
#4 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/includes/class- in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/scanner/class-scanner.php on line 40