Edit File by line
/home/zeestwma/ajeebong.../wp-conte.../plugins/revslide.../admin/includes
File: plugin-update.class.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @author ThemePunch <info@themepunch.com>
[2] Fix | Delete
* @link https://www.themepunch.com/
[3] Fix | Delete
* @copyright 2024 ThemePunch
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if(!defined('ABSPATH')) exit();
[7] Fix | Delete
[8] Fix | Delete
class RevSliderPluginUpdate extends RevSliderFunctions {
[9] Fix | Delete
[10] Fix | Delete
public $revision;
[11] Fix | Delete
public $upgrade_layer_type = false; //holds the type of the layer, for the _compare function to
[12] Fix | Delete
public $add_to_transition_speed = array('slotslide-horizontal' => 200, 'slotslide-vertical' => 200, 'slotzoom-horizontal' => 400, 'slotfade-horizontal' => 1000, 'slotfade-vertical' => 1000, 'fade' => 300, 'crossfade' => 300, 'fadethroughdark' => 300, 'fadethroughlight' => 300, 'fadethroughtransparent' => 300, 'papercut' => 600, '3dcurtain-horizontal' => 100, '3dcurtain-vertical' => 100, 'cubic' => 600, 'cube' => 600, 'flyin' => 600, 'turnoff' => 500, 'incube' => 200, 'cubic-horizontal' => 500, 'cube-horizontal' => 500, 'incube-horizontal' => 500, 'turnoff-vertical' => 200, 'grayscale' => 300, 'grayscalecross' => 300, 'brightness' => 300, 'brightnesscross' => 300, 'blurlight' => 300, 'blurlightcross' => 300, 'blurstrong' => 300, 'blurstrongcross' => 300);
[13] Fix | Delete
public $_respsizesold = array('desktop', 'notebook', 'tablet', 'mobile');
[14] Fix | Delete
public $_respsizes = array('d', 'n', 't', 'm');
[15] Fix | Delete
public $_corners = array('cornerLeft' => array('nothing' => 'none', 'curved' => 'rs-fcr', 'reverced' => 'rs-fcrt'), 'cornerRight' => array('nothing' => 'none', 'curved' => 'rs-bcr', 'reverced' => 'rs-bcrt'));
[16] Fix | Delete
public $_metas = array('home_url', 'current_page_link', 'link', 'title', 'excerpt', 'alias', 'content', 'link', 'date', 'date_modified', 'author_name', 'author_posts', 'author_website', 'num_comments', 'catlist', 'catlist_raw', 'taglist', 'id', 'wc_full_price', 'wc_price', 'wc_price_no_cur', 'wc_stock', 'wc_rating', 'wc_star_rating', 'wc_categories', 'wc_add_to_cart', 'wc_add_to_cart_button', 'wc_sku', 'wc_stock_quantity', 'wc_rating_count', 'wc_review_count', 'wc_tags', 'link', 'title', 'excerpt', 'description', 'alias', 'content', 'link', 'date_published', 'date_modified', 'author_name', 'num_comments', 'catlist', 'catlist_raw', 'taglist', 'likes', 'retweet_count', 'favorite_count', 'views', 't_days', 't_hours', 't_minutes', 't_seconds', 'event_start_date', 'event_end_date', 'event_start_tim', 'event_end_time', 'event_event_id', 'event_location_name', 'event_location_slug', 'event_location_address', 'event_location_town', 'event_location_state', 'event_location_postcode', 'event_location_region', 'event_location_country', 'param1', 'param2', 'param3', 'param4', 'param5', 'param6', 'param7', 'param8', 'param9', 'param10', '/%meta:\w+%/', '/%content:\w+[\:]\w+%/', '/%author_avatar:\w+%/', '/%image_url_\w+%/', '/%image_\w+%/', '/%featured_image_url_\w+%/', '/%featured_image_\w+%/');
[17] Fix | Delete
public $z_index = 5;
[18] Fix | Delete
public $navtypes = array('arrows', 'thumbs', 'bullets', 'tabs', 'scrubber');
[19] Fix | Delete
public $blank_slide = false; //holds a blank slide to remove unneeded values in slides as a compare
[20] Fix | Delete
public $blank_layer = array(); //holds a blank layer to remove unneeded values in layers as a compare, as more than one type of layer exists, it fills with keys as the type
[21] Fix | Delete
public $current_parent = false; //holds the parent key for the compare function, which allows for deeper checks to remove/not remove keys depending on where in the tree we are
[22] Fix | Delete
public $css_navigations = array(); //holds css navigations
[23] Fix | Delete
public $googlefonts = array(); //holds googlefonts
[24] Fix | Delete
public $upd_animations = array(); //holds animations
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* for update to 6.0 added.
[28] Fix | Delete
* These 4 are set by each Slider and depending on their setting.
[29] Fix | Delete
* the layer effects are set to true/false
[30] Fix | Delete
**/
[31] Fix | Delete
public $on_layers = false;
[32] Fix | Delete
public $on_static_layers = false;
[33] Fix | Delete
public $on_parallax_layers = false;
[34] Fix | Delete
public $on_parallax_static_layers = false;
[35] Fix | Delete
public $on_counter = 0;
[36] Fix | Delete
public $static_slide = false;
[37] Fix | Delete
public $parallax_slider = false;
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* for update to 6.0
[41] Fix | Delete
* it holds all layers that are triggered in an action
[42] Fix | Delete
**/
[43] Fix | Delete
public $slide_action_map = array();
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* holds variables needed for certain updates
[47] Fix | Delete
* @since: 6.2.0
[48] Fix | Delete
**/
[49] Fix | Delete
public $update = array(
[50] Fix | Delete
/**
[51] Fix | Delete
* for update to 6.2.0
[52] Fix | Delete
* it holds all easing names that need to be replaced whereever easings are used
[53] Fix | Delete
**/
[54] Fix | Delete
'620' => array(
[55] Fix | Delete
'ease_replace_adv' => array('Power0' => 'power0', 'Power1' => 'power1', 'Power2' => 'power2', 'Power3' => 'power3', 'Power4' => 'power4', 'Back' => 'back', 'Bounce' => 'bounce', 'Circ' => 'circ', 'Elastic' => 'elastic', 'Expo' => 'expo', 'Sine' => 'sine'),
[56] Fix | Delete
'ease_adv_modifier' => array('easeIn' => 'in', 'easeOut' => 'out', 'easeInOut' => 'inOut'),
[57] Fix | Delete
'ease_adv_from' => array('Linear.easeNone', 'SlowMo.ease'),
[58] Fix | Delete
'ease_adv_to' => array('none', 'slow')
[59] Fix | Delete
),
[60] Fix | Delete
/**
[61] Fix | Delete
* for update to 6.6.10
[62] Fix | Delete
* it holds all file path that need to be changed inside the sliders
[63] Fix | Delete
**/
[64] Fix | Delete
'6101' => array(
[65] Fix | Delete
'url_from' => array(
[66] Fix | Delete
'\/public\/assets\/assets\/dummy.png',
[67] Fix | Delete
'\/public\/assets\/assets\/coloredbg-old.png',
[68] Fix | Delete
'\/public\/assets\/assets\/coloredbg.png',
[69] Fix | Delete
'\/public\/assets\/assets\/gridtile_3x3_white.png',
[70] Fix | Delete
'\/public\/assets\/assets\/gridtile_3x3.png',
[71] Fix | Delete
'\/public\/assets\/assets\/gridtile_white.png',
[72] Fix | Delete
'\/public\/assets\/assets\/gridtile.png',
[73] Fix | Delete
'\/public\/assets\/assets\/loader.gif',
[74] Fix | Delete
'\/public\/assets\/assets\/transparent.png',
[75] Fix | Delete
'\/public\/assets\/assets\/svg/',
[76] Fix | Delete
'\/public\/assets\/assets\/sources/'
[77] Fix | Delete
),
[78] Fix | Delete
'url_to' => array(
[79] Fix | Delete
'\/sr6\/assets\/assets\/dummy.png',
[80] Fix | Delete
'\/sr6\/assets\/assets\/coloredbg-old.png',
[81] Fix | Delete
'\/sr6\/assets\/assets\/coloredbg.png',
[82] Fix | Delete
'\/sr6\/assets\/assets\/gridtile_3x3_white.png',
[83] Fix | Delete
'\/sr6\/assets\/assets\/gridtile_3x3.png',
[84] Fix | Delete
'\/sr6\/assets\/assets\/gridtile_white.png',
[85] Fix | Delete
'\/sr6\/assets\/assets\/gridtile.png',
[86] Fix | Delete
'\/sr6\/assets\/assets\/loader.gif',
[87] Fix | Delete
'\/sr6\/assets\/assets\/transparent.png',
[88] Fix | Delete
'\/public\/assets\/svg\/',
[89] Fix | Delete
'\/public\/assets\/sources\/'
[90] Fix | Delete
)
[91] Fix | Delete
)
[92] Fix | Delete
);
[93] Fix | Delete
[94] Fix | Delete
/**
[95] Fix | Delete
* holds wheter we are importing an Slider or if we are updating existing Sliders
[96] Fix | Delete
* this is needed for update routines that should either be done on one of the two Slider types
[97] Fix | Delete
* like in the introduction of it in 6.5.30, where we changed the default of the adpr only for new Sliders!
[98] Fix | Delete
**/
[99] Fix | Delete
public $import = false;
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* @since 5.0
[103] Fix | Delete
*/
[104] Fix | Delete
public function __construct(){
[105] Fix | Delete
$this->revision = get_option('revslider_update_version', '6.0.0');
[106] Fix | Delete
[107] Fix | Delete
foreach($this->update['620']['ease_replace_adv'] as $a_f => $a_t){
[108] Fix | Delete
foreach($this->update['620']['ease_adv_modifier'] as $a_m_f => $a_m_t){
[109] Fix | Delete
$this->update['620']['ease_adv_from'][] = $a_f.'.'.$a_m_f;
[110] Fix | Delete
$this->update['620']['ease_adv_to'][] = $a_t.'.'.$a_m_t;
[111] Fix | Delete
}
[112] Fix | Delete
}
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
public function init_animations(){
[116] Fix | Delete
if(empty($this->upd_animations)){
[117] Fix | Delete
$this->upd_animations = $this->get_layer_animations();
[118] Fix | Delete
}
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
public function init_googlefonts(){
[122] Fix | Delete
if(empty($this->googlefonts)){
[123] Fix | Delete
//direct inclusion for direct searching of google font
[124] Fix | Delete
include(RS_PLUGIN_PATH.'includes/googlefonts.php');
[125] Fix | Delete
$this->googlefonts = $googlefonts;
[126] Fix | Delete
}
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* return version of installation
[131] Fix | Delete
* @since 5.0
[132] Fix | Delete
*/
[133] Fix | Delete
public function get_version(){
[134] Fix | Delete
$real_version = get_option('revslider_update_version', 1.0);
[135] Fix | Delete
if(in_array($real_version, array('6.10.0', '6.10.1'), true)) $real_version = '6.6.20'; //this were dev versions
[136] Fix | Delete
[137] Fix | Delete
return $real_version;
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* set version of installation
[142] Fix | Delete
* @since 5.0
[143] Fix | Delete
*/
[144] Fix | Delete
public function set_version($set_to){
[145] Fix | Delete
update_option('revslider_update_version', $set_to);
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
/**
[149] Fix | Delete
* set import value
[150] Fix | Delete
* @since 6.5.30
[151] Fix | Delete
*/
[152] Fix | Delete
public function set_import($import){
[153] Fix | Delete
$this->import = $import;
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
/**
[157] Fix | Delete
* check for updates and proceed if needed
[158] Fix | Delete
* @since 5.0
[159] Fix | Delete
*/
[160] Fix | Delete
public static function do_update_checks(){
[161] Fix | Delete
$upd = new RevSliderPluginUpdate();
[162] Fix | Delete
$version = $upd->get_version();
[163] Fix | Delete
[164] Fix | Delete
if(version_compare($version, 5.0, '<')){
[165] Fix | Delete
$upd->update_css_styles(); //update styles to the new 5.0 way
[166] Fix | Delete
$upd->add_v5_styles(); //add the version 5 styles that are new!
[167] Fix | Delete
$upd->check_settings_table(); //remove the usage of the settings table
[168] Fix | Delete
$upd->add_animation_settings_to_layer(); //set missing animation fields to the slides layers
[169] Fix | Delete
$upd->add_style_settings_to_layer(); //set missing styling fields to the slides layers
[170] Fix | Delete
$upd->change_settings_on_layers(); //change settings on layers, for example, add the new structure of actions
[171] Fix | Delete
$upd->add_general_settings(); //set general settings
[172] Fix | Delete
$upd->translate_navigation_to_v5(); //set the navigation from v4.** to v5
[173] Fix | Delete
[174] Fix | Delete
$upd->remove_static_slides(); //remove static slides if the slider was v4 and had static slides which were not enabled
[175] Fix | Delete
[176] Fix | Delete
$version = 5.0;
[177] Fix | Delete
$upd->set_version($version);
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
if(version_compare($version, '5.0.7', '<')){
[181] Fix | Delete
$version = '5.0.7';
[182] Fix | Delete
[183] Fix | Delete
$upd->change_general_settings_5_0_7();
[184] Fix | Delete
$upd->set_version($version);
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
if(version_compare($version, '5.1.1', '<')){
[188] Fix | Delete
$version = '5.1.1';
[189] Fix | Delete
[190] Fix | Delete
$upd->change_slide_settings_5_1_1();
[191] Fix | Delete
$upd->set_version($version);
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
if(version_compare($version, '5.2.5.5', '<')){
[195] Fix | Delete
$version = '5.2.5.5';
[196] Fix | Delete
$upd->change_layers_svg_5_2_5_5();
[197] Fix | Delete
$upd->set_version($version);
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
//with 6.0, the slider, slide, layer changes are done at a background process if possible, not automatically
[201] Fix | Delete
//only push global changes in here outside of slider, slides and layers
[202] Fix | Delete
if(version_compare($version, '6.0', '<')){
[203] Fix | Delete
$version = '6.0';
[204] Fix | Delete
$upd->change_global_settings_to_6_0();
[205] Fix | Delete
$upd->change_navigation_settings_to_6_0();
[206] Fix | Delete
$upd->change_animations_settings_to_6_0();
[207] Fix | Delete
[208] Fix | Delete
// new addition for global addons
[209] Fix | Delete
$upd->change_global_addon_settings_to_6_0();
[210] Fix | Delete
$upd->set_version($version);
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
//with 6.1.4, we check the animations again for custom animations
[214] Fix | Delete
if(version_compare($version, '6.1.4', '<')){
[215] Fix | Delete
$version = '6.1.4';
[216] Fix | Delete
[217] Fix | Delete
$upd->change_animations_settings_to_6_0();
[218] Fix | Delete
$upd->set_version($version);
[219] Fix | Delete
}
[220] Fix | Delete
[221] Fix | Delete
//with 6.1.6, we only set the version and upgrade_slider_to_latest() will do the rest
[222] Fix | Delete
if(version_compare($version, '6.1.6', '<')){
[223] Fix | Delete
$version = '6.1.6';
[224] Fix | Delete
$upd->set_version($version);
[225] Fix | Delete
}
[226] Fix | Delete
[227] Fix | Delete
//with 6.2.0, we check the animations handles again and change them to a new format
[228] Fix | Delete
if(version_compare($version, '6.2.0', '<')){
[229] Fix | Delete
$version = '6.2.0';
[230] Fix | Delete
[231] Fix | Delete
$upd->change_animations_settings_to_6_2_0();
[232] Fix | Delete
$upd->change_global_settings_to_6_2_0();
[233] Fix | Delete
$upd->set_version($version);
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
//add this so that sliders will be updated if under 6.4.0
[237] Fix | Delete
if(version_compare($version, '6.4.0', '<')){
[238] Fix | Delete
$upd->set_version('6.4.0');
[239] Fix | Delete
}
[240] Fix | Delete
[241] Fix | Delete
//add this so that sliders will be updated if under 6.4.10
[242] Fix | Delete
if(version_compare($version, '6.4.10', '<')){
[243] Fix | Delete
$upd->change_navigation_settings_to_6_4_10();
[244] Fix | Delete
$upd->set_version('6.4.10');
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
if(version_compare($version, '6.5.12', '<')){
[248] Fix | Delete
//$upd->set_version('6.5.12');
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
if(version_compare($version, '6.5.20', '<')){
[252] Fix | Delete
$upd->set_version('6.5.20');
[253] Fix | Delete
}
[254] Fix | Delete
[255] Fix | Delete
if(version_compare($version, '6.5.26', '<')){
[256] Fix | Delete
$upd->set_version('6.5.26');
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
if(version_compare($version, '6.6.0', '<')){
[260] Fix | Delete
$upd->set_version('6.6.0');
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
if(version_compare($version, '6.6.10', '<')){
[264] Fix | Delete
//remove templates from the database
[265] Fix | Delete
$upd->remove_template_sliders();
[266] Fix | Delete
$upd->set_version('6.6.10');
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
if(version_compare($version, '6.6.20', '<')){
[270] Fix | Delete
$upd->set_version('6.6.20');
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
if(version_compare($version, '6.6.21', '<')){
[274] Fix | Delete
$upd->set_version('6.6.21');
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
if(version_compare($version, '6.7.24', '<')){
[278] Fix | Delete
$upd->update_post_slide_template_v7();
[279] Fix | Delete
$upd->set_version('6.7.24');
[280] Fix | Delete
}
[281] Fix | Delete
}
[282] Fix | Delete
[283] Fix | Delete
/**
[284] Fix | Delete
* check to convert the given Slider to latest versions
[285] Fix | Delete
* @since: 6.0
[286] Fix | Delete
**/
[287] Fix | Delete
public function upgrade_slider_to_latest($slider){
[288] Fix | Delete
$version = $slider->get_setting('version', '1.0.0');
[289] Fix | Delete
if(in_array($version, array('6.10.0', '6.10.1'), true)) $version = '6.6.20'; //this were dev versions
[290] Fix | Delete
[291] Fix | Delete
if(version_compare($version, '6.0.0', '<')){
[292] Fix | Delete
//$this->update_css_styles(); //set to version 5
[293] Fix | Delete
$this->add_animation_settings_to_layer($slider); //set to version 5
[294] Fix | Delete
$this->add_style_settings_to_layer($slider); //set to version 5
[295] Fix | Delete
$this->change_settings_on_layers($slider); //set to version 5
[296] Fix | Delete
$this->add_general_settings($slider); //set to version 5
[297] Fix | Delete
$this->change_general_settings_5_0_7($slider); //set to version 5.0.7
[298] Fix | Delete
$this->change_layers_svg_5_2_5_5($slider); //set to version 5.2.5.5
[299] Fix | Delete
$this->change_animations_settings_to_6_0(); //check if new navigations are added through import
[300] Fix | Delete
$this->upgrade_slider_to_6_0($slider);
[301] Fix | Delete
}
[302] Fix | Delete
[303] Fix | Delete
if(version_compare($version, '6.1.4', '<')){
[304] Fix | Delete
$this->upgrade_slider_to_6_1_4($slider);
[305] Fix | Delete
}
[306] Fix | Delete
[307] Fix | Delete
if(version_compare($version, '6.1.6', '<')){
[308] Fix | Delete
$this->upgrade_slider_to_6_1_6($slider);
[309] Fix | Delete
}
[310] Fix | Delete
[311] Fix | Delete
if(version_compare($version, '6.2.0', '<')){
[312] Fix | Delete
$this->change_animations_settings_to_6_2_0(); //check if new navigations are added through import
[313] Fix | Delete
$this->upgrade_slider_to_6_2_0($slider);
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
if(version_compare($version, '6.4.0', '<')){
[317] Fix | Delete
$this->upgrade_slider_to_6_4_0($slider);
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
if(version_compare($version, '6.4.10', '<')){
[321] Fix | Delete
$this->change_navigation_settings_to_6_4_10();
[322] Fix | Delete
$this->upgrade_slider_to_6_4_10($slider);
[323] Fix | Delete
}
[324] Fix | Delete
[325] Fix | Delete
if(version_compare($version, '6.5.12', '<')){
[326] Fix | Delete
$this->upgrade_slider_to_6_5_12($slider);
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
if($this->import === false){
[330] Fix | Delete
if(version_compare($version, '6.5.26', '<')){
[331] Fix | Delete
$this->upgrade_slider_to_6_5_26($slider);
[332] Fix | Delete
}
[333] Fix | Delete
}
[334] Fix | Delete
[335] Fix | Delete
if(version_compare($version, '6.6.0', '<')){
[336] Fix | Delete
$this->upgrade_slider_to_6_6_0($slider);
[337] Fix | Delete
}
[338] Fix | Delete
[339] Fix | Delete
if(version_compare($version, '6.6.10', '<')){
[340] Fix | Delete
$this->upgrade_slider_to_6_6_10($slider);
[341] Fix | Delete
}
[342] Fix | Delete
[343] Fix | Delete
if(version_compare($version, '6.6.20', '<')){
[344] Fix | Delete
$this->upgrade_slider_to_6_6_20($slider);
[345] Fix | Delete
}
[346] Fix | Delete
[347] Fix | Delete
if(version_compare($version, '6.7.21', '<')){
[348] Fix | Delete
$this->upgrade_slider_to_6_7_21($slider);
[349] Fix | Delete
}
[350] Fix | Delete
[351] Fix | Delete
if(version_compare($version, '6.7.24', '<')){
[352] Fix | Delete
$this->upgrade_slider_to_6_7_24($slider);
[353] Fix | Delete
}
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
/**
[357] Fix | Delete
* get the CSS Navigation advanced styles, needed for 6.0
[358] Fix | Delete
* @since: 6.0
[359] Fix | Delete
**/
[360] Fix | Delete
public function get_css_navigations(){
[361] Fix | Delete
if(empty($this->css_navigations)){
[362] Fix | Delete
$css_parser = RevSliderGlobals::instance()->get('RevSliderCssParser');
[363] Fix | Delete
$this->css_navigations = $css_parser->get_database_classes(true);
[364] Fix | Delete
}
[365] Fix | Delete
return $this->css_navigations;
[366] Fix | Delete
}
[367] Fix | Delete
[368] Fix | Delete
/**
[369] Fix | Delete
* check if there are still Slider below latest version, if yes then add JavaScript to the header
[370] Fix | Delete
* @since: 6.0.0
[371] Fix | Delete
**/
[372] Fix | Delete
public function slider_need_update_checks(){
[373] Fix | Delete
$finished = get_option('revslider_update_revision_current', '1.0.0');
[374] Fix | Delete
if(in_array($finished, array('6.10.0', '6.10.1'), true)) $finished = '6.6.20'; //this were dev versions
[375] Fix | Delete
[376] Fix | Delete
return (version_compare($finished, $this->revision, '<')) ? true : false;
[377] Fix | Delete
}
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
* get the next slider that is not on the latest version and update it to the latest
[381] Fix | Delete
* @since: 6.0.0
[382] Fix | Delete
* @since: 6.2.0: added template sliders to the update routine
[383] Fix | Delete
**/
[384] Fix | Delete
public function upgrade_next_slider(){
[385] Fix | Delete
$slr = new RevSliderSlider();
[386] Fix | Delete
[387] Fix | Delete
$sliders = $slr->get_sliders();
[388] Fix | Delete
if(!empty($sliders)){
[389] Fix | Delete
foreach($sliders as $slider){
[390] Fix | Delete
$version = $this->get_val($slider, array('settings', 'version'));
[391] Fix | Delete
if(in_array($version, array('6.10.0', '6.10.1'), true)) $version = '6.6.20'; //this were dev versions
[392] Fix | Delete
[393] Fix | Delete
if(version_compare($version, $this->revision, '<')){
[394] Fix | Delete
$this->upgrade_slider_to_latest($slider);
[395] Fix | Delete
return array('status' => 'next');
[396] Fix | Delete
}
[397] Fix | Delete
}
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
//we can only get to this point, after all Sliders have been updated to the latest revision
[401] Fix | Delete
update_option('revslider_update_revision_current', $this->revision);
[402] Fix | Delete
[403] Fix | Delete
return array('status' => 'finished');
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
/**
[407] Fix | Delete
* check to convert the given Slider to latest versions
[408] Fix | Delete
* @since: 6.0
[409] Fix | Delete
**/
[410] Fix | Delete
public function upgrade_slider_to_6_0($slider){
[411] Fix | Delete
ini_set('max_execution_time', 300);
[412] Fix | Delete
[413] Fix | Delete
$upd = new RevSliderPluginUpdate();
[414] Fix | Delete
$upd->change_navigation_slider_to_6_0($slider);
[415] Fix | Delete
$upd->change_slider_settings_to_6_0($slider); //set to version 6.0
[416] Fix | Delete
$upd->change_slide_settings_to_6_0($slider); //set to version 6.0
[417] Fix | Delete
$upd->change_layer_settings_to_6_0($slider); //set to version 6.0
[418] Fix | Delete
[419] Fix | Delete
$upd->remove_unneeded_slider_settings($slider);
[420] Fix | Delete
}
[421] Fix | Delete
[422] Fix | Delete
/**
[423] Fix | Delete
* check to convert the given Slider to latest versions
[424] Fix | Delete
* @since: 6.1.4
[425] Fix | Delete
* reverse the carousel.scaleDown value. If it was 85, change it to 15 and vice versa
[426] Fix | Delete
**/
[427] Fix | Delete
public function upgrade_slider_to_6_1_4($sliders = false){
[428] Fix | Delete
$sr = new RevSliderSlider();
[429] Fix | Delete
[430] Fix | Delete
$sliders = ($sliders === false) ? $sr->get_sliders() : array($sliders); //do it on all Sliders if false
[431] Fix | Delete
[432] Fix | Delete
if(!empty($sliders) && is_array($sliders)){
[433] Fix | Delete
foreach($sliders as $slider){
[434] Fix | Delete
$carousel = $slider->get_param('carousel', array());
[435] Fix | Delete
$scale_down = $this->get_val($carousel, 'scaleDown');
[436] Fix | Delete
[437] Fix | Delete
if($scale_down !== false){
[438] Fix | Delete
$carousel['scaleDown'] = 100 - intval($scale_down);
[439] Fix | Delete
$slider->update_params(array('carousel' => $carousel));
[440] Fix | Delete
}
[441] Fix | Delete
[442] Fix | Delete
$slider->update_settings(array('version' => '6.1.4'));
[443] Fix | Delete
}
[444] Fix | Delete
}
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
/**
[448] Fix | Delete
* check to convert the given Slider to latest versions
[449] Fix | Delete
* @since: 6.1.6
[450] Fix | Delete
* check in the slide transitions, if we have a transition with a ","
[451] Fix | Delete
* if this is the case, split it up
[452] Fix | Delete
**/
[453] Fix | Delete
public function upgrade_slider_to_6_1_6($sliders = false){
[454] Fix | Delete
$sr = new RevSliderSlider();
[455] Fix | Delete
$sl = new RevSliderSlide();
[456] Fix | Delete
[457] Fix | Delete
$sliders = ($sliders === false) ? $sr->get_sliders() : array($sliders); //do it on all Sliders if false
[458] Fix | Delete
[459] Fix | Delete
if(!empty($sliders) && is_array($sliders)){
[460] Fix | Delete
foreach($sliders as $slider){
[461] Fix | Delete
$slides = $slider->get_slides(false, true);
[462] Fix | Delete
$static_id = $sl->get_static_slide_id($slider->get_id());
[463] Fix | Delete
if($static_id !== false){
[464] Fix | Delete
$msl = new RevSliderSlide();
[465] Fix | Delete
if(strpos($static_id, 'static_') === false){
[466] Fix | Delete
$static_id = 'static_'. $static_id; //$slider->get_id();
[467] Fix | Delete
}
[468] Fix | Delete
$msl->init_by_id($static_id);
[469] Fix | Delete
if($msl->get_id() !== ''){
[470] Fix | Delete
$slides = array_merge($slides, array($msl));
[471] Fix | Delete
}
[472] Fix | Delete
}
[473] Fix | Delete
[474] Fix | Delete
if(!empty($slides) && is_array($slides)){
[475] Fix | Delete
foreach($slides as $slide){
[476] Fix | Delete
$settings = $slide->get_settings();
[477] Fix | Delete
if(version_compare($this->get_val($settings, 'version', '1.0.0'), '6.1.6', '<')){
[478] Fix | Delete
$params = $slide->get_params();
[479] Fix | Delete
$transitions = $this->get_val($params, array('timeline', 'transition'), array());
[480] Fix | Delete
$new_transitions = array();
[481] Fix | Delete
$save = false;
[482] Fix | Delete
if(!empty($transitions) && is_array($transitions)){
[483] Fix | Delete
foreach($transitions as $t => $v){
[484] Fix | Delete
if(strpos($v, ',') !== false){
[485] Fix | Delete
$save = true;
[486] Fix | Delete
$_v = explode(',', $v);
[487] Fix | Delete
if(!empty($_v)){
[488] Fix | Delete
foreach($_v as $k => $__v){
[489] Fix | Delete
$new_transitions[] = $__v;
[490] Fix | Delete
}
[491] Fix | Delete
}
[492] Fix | Delete
}else{
[493] Fix | Delete
$new_transitions[] = $v;
[494] Fix | Delete
}
[495] Fix | Delete
}
[496] Fix | Delete
if($save){
[497] Fix | Delete
$this->set_val($params, array('timeline', 'transition'), $new_transitions);
[498] Fix | Delete
$slide->set_params($params);
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function