| Server IP : 172.67.159.97 / Your IP : 216.73.217.154 Web Server : nginx/1.24.0 System : Linux wordpress-sites 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/rebeccaone.com/wp-content/plugins/revslider/includes/external/ |
Upload File : |
<?php
/**
* External Sources Vimeo Class
* @since: 5.0
* @author ThemePunch <[email protected]>
* @link https://www.sliderrevolution.com/
* @copyright 2024 ThemePunch
*/
if(!defined('ABSPATH')) exit();
/**
* Vimeo
*
* with help of the API this class delivers all kind of Images/Videos from Vimeo
*
* @package socialstreams
* @subpackage socialstreams/vimeo
* @author ThemePunch <[email protected]>
*/
class RevSliderVimeo extends RevSliderFunctions {
/**
* Stream Array
*
* @access private
* @var array $stream Stream Data Array
*/
private $stream;
/**
* Transient seconds
*
* @access private
* @var number $transient Transient time in seconds
*/
private $transient_sec;
/**
* Initialize the class and set its properties.
*
* @param string $api_key Youtube API key.
*/
public function __construct($transient_sec = 1200){
$this->transient_sec = $transient_sec;
}
/**
* Get Vimeo User Videos
*
*/
public function get_vimeo_videos($type, $value, $elements = 20){
//call the API and decode the response
$url = 'https://vimeo.com/api/v2/';
$url .= ($type == 'user') ? $value.'/videos.json' : $type.'/'.$value.'/videos.json';
$transient_name = 'revslider_' . md5($url.$elements);
if($this->transient_sec > 0 && false !== ($data = get_transient($transient_name))) return ($data);
$elements = intval($elements);
$page = 1;
$rsp = [];
do {
$_rsp = json_decode(wp_remote_fopen($url.'?page='.$page));
if(!empty($_rsp) && is_array($_rsp)) $rsp = array_merge($rsp, $_rsp);
$page++;
$elements -= 20;
} while($elements > 0);
set_transient($transient_name, $rsp, $this->transient_sec);
return $rsp;
}
} // End Class