y( $theme['wordpress_theme_metadata']['theme_name'] ) ? $theme['wordpress_theme_metadata']['theme_name'] : '' ),
'author' => ( ! empty( $theme['wordpress_theme_metadata']['author_name'] ) ? $theme['wordpress_theme_metadata']['author_name'] : '' ),
'version' => ( ! empty( $theme['wordpress_theme_metadata']['version'] ) ? $theme['wordpress_theme_metadata']['version'] : '' ),
'description' => self::remove_non_unicode( strip_tags( $theme['wordpress_theme_metadata']['description'] ) ),
'url' => ( ! empty( $theme['url'] ) ? $theme['url'] : '' ),
'author_url' => ( ! empty( $theme['author_url'] ) ? $theme['author_url'] : '' ),
'thumbnail_url' => ( ! empty( $theme['thumbnail_url'] ) ? $theme['thumbnail_url'] : '' ),
'rating' => ( ! empty( $theme['rating'] ) ? $theme['rating'] : '' ),
'landscape_url' => '',
);
// No main thumbnail in API response, so we grab it from the preview array.
if ( empty( $normalized_theme['thumbnail_url'] ) && ! empty( $theme['previews'] ) && is_array( $theme['previews'] ) ) {
foreach ( $theme['previews'] as $possible_preview ) {
if ( ! empty( $possible_preview['landscape_url'] ) ) {
$normalized_theme['landscape_url'] = $possible_preview['landscape_url'];
break;
}
}
}
if ( empty( $normalized_theme['thumbnail_url'] ) && ! empty( $theme['previews'] ) && is_array( $theme['previews'] ) ) {
foreach ( $theme['previews'] as $possible_preview ) {
if ( ! empty( $possible_preview['icon_url'] ) ) {
$normalized_theme['thumbnail_url'] = $possible_preview['icon_url'];
break;
}
}
}
return $normalized_theme;
}
/**
* Get the list of available plugins.
*
* @since 1.0.0
*
* @param array $args The arguments passed to `wp_remote_get`.
* @return array The HTTP response.
*/
public function plugins( $args = array() ) {
$plugins = array();
$domain = envato_market()->get_envato_api_domain();
$path = $this->api_path_for('list-purchases');
$url = $domain . $path . '?filter_by=wordpress-plugins';
$response = $this->request( $url, $args );
if ( is_wp_error( $response ) || empty( $response ) || empty( $response['results'] ) ) {
return $plugins;
}
foreach ( $response['results'] as $plugin ) {
$plugins[] = $this->normalize_plugin( $plugin['item'] );
}
return $plugins;
}
/**
* Normalize a plugin.
*
* @since 1.0.0
*
* @param array $plugin An array of API request values.
* @return array A normalized array of values.
*/
public function normalize_plugin( $plugin ) {
$requires = null;
$tested = null;
$versions = array();
// Set the required and tested WordPress version numbers.
foreach ( $plugin['attributes'] as $k => $v ) {
if ( ! empty( $v['name'] ) && 'compatible-software' === $v['name'] && ! empty( $v['value'] ) && is_array( $v['value'] ) ) {
foreach ( $v['value'] as $version ) {
$versions[] = str_replace( 'WordPress ', '', trim( $version ) );
}
if ( ! empty( $versions ) ) {
$requires = $versions[ count( $versions ) - 1 ];
$tested = $versions[0];
}
break;
}
}
$plugin_normalized = array(
'id' => $plugin['id'],
'name' => ( ! empty( $plugin['wordpress_plugin_metadata']['plugin_name'] ) ? $plugin['wordpress_plugin_metadata']['plugin_name'] : '' ),
'author' => ( ! empty( $plugin['wordpress_plugin_metadata']['author'] ) ? $plugin['wordpress_plugin_metadata']['author'] : '' ),
'version' => ( ! empty( $plugin['wordpress_plugin_metadata']['version'] ) ? $plugin['wordpress_plugin_metadata']['version'] : '' ),
'description' => self::remove_non_unicode( strip_tags( $plugin['wordpress_plugin_metadata']['description'] ) ),
'url' => ( ! empty( $plugin['url'] ) ? $plugin['url'] : '' ),
'author_url' => ( ! empty( $plugin['author_url'] ) ? $plugin['author_url'] : '' ),
'thumbnail_url' => ( ! empty( $plugin['thumbnail_url'] ) ? $plugin['thumbnail_url'] : '' ),
'landscape_url' => ( ! empty( $plugin['previews']['landscape_preview']['landscape_url'] ) ? $plugin['previews']['landscape_preview']['landscape_url'] : '' ),
'requires' => $requires,
'tested' => $tested,
'number_of_sales' => ( ! empty( $plugin['number_of_sales'] ) ? $plugin['number_of_sales'] : '' ),
'updated_at' => ( ! empty( $plugin['updated_at'] ) ? $plugin['updated_at'] : '' ),
'rating' => ( ! empty( $plugin['rating'] ) ? $plugin['rating'] : '' ),
);
// No main thumbnail in API response, so we grab it from the preview array.
if ( empty( $plugin_normalized['landscape_url'] ) && ! empty( $plugin['previews'] ) && is_array( $plugin['previews'] ) ) {
foreach ( $plugin['previews'] as $possible_preview ) {
if ( ! empty( $possible_preview['landscape_url'] ) ) {
$plugin_normalized['landscape_url'] = $possible_preview['landscape_url'];
break;
}
}
}
if ( empty( $plugin_normalized['thumbnail_url'] ) && ! empty( $plugin['previews'] ) && is_array( $plugin['previews'] ) ) {
foreach ( $plugin['previews'] as $possible_preview ) {
if ( ! empty( $possible_preview['icon_url'] ) ) {
$plugin_normalized['thumbnail_url'] = $possible_preview['icon_url'];
break;
}
}
}
return $plugin_normalized;
}
public function api_path_for( $path ) {
if ( defined('ENVATO_LOCAL_DEVELOPMENT') ) {
$paths = MONOLITH_API_PATHS;
} else {
$paths = array(
'download' => '/v2/market/buyer/download',
'catalog-item' => '/v2/market/catalog/item',
'list-purchases' => '/v2/market/buyer/list-purchases',
'total-items' => '/v1/market/total-items.json'
);
}
return $paths[$path];
}
/**
* Remove all non unicode characters in a string
*
* @since 1.0.0
*
* @param string $retval The string to fix.
* @return string
*/
static private function remove_non_unicode( $retval ) {
return preg_replace( '/[\x00-\x1F\x80-\xFF]/', '', $retval );
}
private function request_headers() {
$user_agent = array('User-Agent' => 'WordPress - Envato Market ' . envato_market()->get_version());
$headers = array_merge($user_agent, envato_market()->get_envato_api_headers());
return $headers;
}
}
endif;
Fatal error: require_once(): Failed opening required '/var/www/html/helitower.com.br/web/wp-content/plugins/revslider/includes/globals.class.php' (include_path='.:/usr/share/pear') in /var/www/html/helitower.com.br/web/wp-content/plugins/revslider/revslider.php on line 119