| 1 |
<?php |
| 2 |
/* |
| 3 |
* License: GPLv3 |
| 4 |
* License URI: https://www.gnu.org/licenses/gpl.txt |
| 5 |
* Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/) |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
|
| 10 |
die( 'These aren\'t the droids you\'re looking for.' ); |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! class_exists( 'WpssoUpgrade' ) ) { |
| 14 |
|
| 15 |
class WpssoUpgrade { |
| 16 |
|
| 17 |
private $p; // Wpsso class object. |
| 18 |
|
| 19 |
private static $rename_options = array( |
| 20 |
'wpsso' => array( // WPSSO Core plugin. |
| 21 |
500 => array( |
| 22 |
'og_img_resize' => '', |
| 23 |
'plugin_tid' => 'plugin_wpsso_tid', |
| 24 |
'og_publisher_url' => 'fb_publisher_url', |
| 25 |
'add_meta_property_og:video' => 'add_meta_property_og:video:url', |
| 26 |
'twitter_shortener' => 'plugin_shortener', |
| 27 |
'og_desc_strip' => '', |
| 28 |
'og_desc_alt' => '', |
| 29 |
'add_meta_name_twitter:data1' => '', |
| 30 |
'add_meta_name_twitter:label1' => '', |
| 31 |
'add_meta_name_twitter:data2' => '', |
| 32 |
'add_meta_name_twitter:label2' => '', |
| 33 |
'add_meta_name_twitter:data3' => '', |
| 34 |
'add_meta_name_twitter:label3' => '', |
| 35 |
'add_meta_name_twitter:data4' => '', |
| 36 |
'add_meta_name_twitter:label4' => '', |
| 37 |
'tc_enable' => '', |
| 38 |
'tc_photo_width' => '', |
| 39 |
'tc_photo_height' => '', |
| 40 |
'tc_photo_crop' => '', |
| 41 |
'tc_photo_crop_x' => '', |
| 42 |
'tc_photo_crop_y' => '', |
| 43 |
'tc_gal_min' => '', |
| 44 |
'tc_gal_width' => '', |
| 45 |
'tc_gal_height' => '', |
| 46 |
'tc_gal_crop' => '', |
| 47 |
'tc_gal_crop_x' => '', |
| 48 |
'tc_gal_crop_y' => '', |
| 49 |
'tc_prod_width' => '', |
| 50 |
'tc_prod_height' => '', |
| 51 |
'tc_prod_crop' => '', |
| 52 |
'tc_prod_crop_x' => '', |
| 53 |
'tc_prod_crop_y' => '', |
| 54 |
'tc_prod_labels' => '', |
| 55 |
'tc_prod_def_label2' => '', |
| 56 |
'tc_prod_def_data2' => '', |
| 57 |
'plugin_version' => '', |
| 58 |
'plugin_columns_taxonomy' => 'plugin_columns_term', |
| 59 |
'plugin_add_to_taxonomy' => '', |
| 60 |
'plugin_ignore_small_img' => 'plugin_check_img_dims', |
| 61 |
'plugin_file_cache_exp' => '', |
| 62 |
'plugin_object_cache_exp' => '', |
| 63 |
'buttons_use_social_css' => 'buttons_use_social_style', |
| 64 |
'buttons_enqueue_social_css' => 'buttons_enqueue_social_style', |
| 65 |
'fb_type' => 'fb_share_layout', |
| 66 |
'plugin_schema_type_id_col_post' => 'plugin_schema_type_col_post', |
| 67 |
'plugin_schema_type_id_col_term' => 'plugin_schema_type_col_term', |
| 68 |
'plugin_schema_type_id_col_user' => 'plugin_schema_type_col_user', |
| 69 |
'plugin_auto_img_resize' => '', |
| 70 |
'plugin_cache_info' => '', |
| 71 |
'tc_sum_width' => 'tc_sum_img_width', |
| 72 |
'tc_sum_height' => 'tc_sum_img_height', |
| 73 |
'tc_sum_crop' => 'tc_sum_img_crop', |
| 74 |
'tc_sum_crop_x' => 'tc_sum_img_crop_x', |
| 75 |
'tc_sum_crop_y' => 'tc_sum_img_crop_y', |
| 76 |
'tc_lrgimg_width' => 'tc_lrg_img_width', |
| 77 |
'tc_lrgimg_height' => 'tc_lrg_img_height', |
| 78 |
'tc_lrgimg_crop' => 'tc_lrg_img_crop', |
| 79 |
'tc_lrgimg_crop_x' => 'tc_lrg_img_crop_x', |
| 80 |
'tc_lrgimg_crop_y' => 'tc_lrg_img_crop_y', |
| 81 |
'schema_img_article_width' => '', |
| 82 |
'schema_img_article_height' => '', |
| 83 |
'schema_img_article_crop' => '', |
| 84 |
'schema_img_article_crop_x' => '', |
| 85 |
'schema_img_article_crop_y' => '', |
| 86 |
'og_site_name' => 'site_name', |
| 87 |
'og_site_description' => 'site_desc', |
| 88 |
'org_url' => 'site_home_url', |
| 89 |
'org_type' => 'site_org_schema_type', |
| 90 |
'org_place_id' => 'site_org_place_id', |
| 91 |
'link_def_author_id' => '', |
| 92 |
'link_def_author_on_index' => '', |
| 93 |
'link_def_author_on_search' => '', |
| 94 |
'seo_def_author_id' => '', |
| 95 |
'seo_def_author_on_index' => '', |
| 96 |
'seo_def_author_on_search' => '', |
| 97 |
'og_def_author_id' => '', |
| 98 |
'og_def_author_on_index' => '', |
| 99 |
'og_def_author_on_search' => '', |
| 100 |
'tweet_button_css' => '', |
| 101 |
'tweet_button_js' => '', |
| 102 |
'plugin_verify_certs' => '', |
| 103 |
), |
| 104 |
514 => array( |
| 105 |
'rp_publisher_url' => 'pin_publisher_url', |
| 106 |
'rp_author_name' => '', |
| 107 |
'rp_img_width' => 'pin_img_width', |
| 108 |
'rp_img_height' => 'pin_img_height', |
| 109 |
'rp_img_crop' => 'pin_img_crop', |
| 110 |
'rp_img_crop_x' => 'pin_img_crop_x', |
| 111 |
'rp_img_crop_y' => 'pin_img_crop_y', |
| 112 |
'rp_dom_verify' => 'pin_site_verify', |
| 113 |
), |
| 114 |
525 => array( |
| 115 |
'add_meta_itemprop_url' => '', |
| 116 |
'add_meta_itemprop_image' => '', |
| 117 |
'add_meta_itemprop_image.url' => '', |
| 118 |
'add_meta_itemprop_author.url' => '', |
| 119 |
'add_meta_itemprop_author.image' => '', |
| 120 |
'add_meta_itemprop_contributor.url' => '', |
| 121 |
'add_meta_itemprop_contributor.image' => '', |
| 122 |
'add_meta_itemprop_menu' => '', |
| 123 |
), |
| 124 |
532 => array( |
| 125 |
'plugin_bitly_token' => 'plugin_bitly_access_token', |
| 126 |
), |
| 127 |
539 => array( |
| 128 |
'plugin_shorten_cache_exp' => '', |
| 129 |
), |
| 130 |
541 => array( |
| 131 |
'plugin_content_img_max' => '', |
| 132 |
'plugin_content_vid_max' => '', |
| 133 |
'og_def_vid_url' => '', |
| 134 |
'og_def_vid_on_index' => '', |
| 135 |
'og_def_vid_on_search' => '', |
| 136 |
), |
| 137 |
559 => array( |
| 138 |
'plugin_product_currency' => 'og_def_currency', |
| 139 |
), |
| 140 |
561 => array( |
| 141 |
'plugin_shortlink' => 'plugin_wp_shortlink', |
| 142 |
), |
| 143 |
569 => array( |
| 144 |
'plugin_cf_add_type_urls' => 'plugin_cf_addl_type_urls', |
| 145 |
'schema_organization_json' => 'schema_add_home_organization', |
| 146 |
'schema_person_json' => 'schema_add_home_person', |
| 147 |
'schema_website_json' => '', |
| 148 |
'schema_person_id' => 'site_pub_person_id', |
| 149 |
), |
| 150 |
574 => array( |
| 151 |
'plugin_json_post_data_cache_exp' => '', |
| 152 |
), |
| 153 |
575 => array( |
| 154 |
'site_alt_name' => 'site_name_alt', |
| 155 |
'schema_alt_name' => 'site_name_alt', |
| 156 |
), |
| 157 |
580 => array( |
| 158 |
'plugin_shortcodes' => '', |
| 159 |
'plugin_widgets' => '', |
| 160 |
), |
| 161 |
581 => array( |
| 162 |
'og_page_title_tag' => '', |
| 163 |
'og_page_parent_tags' => '', |
| 164 |
), |
| 165 |
582 => array( |
| 166 |
'add_meta_property_og:image' => 'add_meta_property_og:image:url', |
| 167 |
), |
| 168 |
583 => array( |
| 169 |
'og_author_fallback' => '', |
| 170 |
'og_def_img_on_index' => '', |
| 171 |
'og_def_img_on_search' => '', |
| 172 |
'og_ngg_tags' => '', |
| 173 |
), |
| 174 |
587 => array( |
| 175 |
'og_post_type' => '', |
| 176 |
), |
| 177 |
592 => array( |
| 178 |
'add_meta_property_product:rating:average' => '', |
| 179 |
'add_meta_property_product:rating:count' => '', |
| 180 |
'add_meta_property_product:rating:worst' => '', |
| 181 |
'add_meta_property_product:rating:best' => '', |
| 182 |
), |
| 183 |
599 => array( |
| 184 |
'plugin_add_person_role' => 'plugin_new_user_is_person', |
| 185 |
), |
| 186 |
602 => array( |
| 187 |
'plugin_preserve' => '', |
| 188 |
), |
| 189 |
609 => array( |
| 190 |
'p_author_name' => '', |
| 191 |
), |
| 192 |
616 => array( |
| 193 |
'site_org_type' => 'site_org_schema_type', |
| 194 |
'schema_desc_len' => '', |
| 195 |
'og_title_len' => '', |
| 196 |
'og_title_warn' => '', |
| 197 |
'og_desc_len' => '', |
| 198 |
'og_desc_warn' => '', |
| 199 |
'seo_desc_len' => '', |
| 200 |
'tc_desc_len' => '', |
| 201 |
), |
| 202 |
618 => array( |
| 203 |
'fb_author_name' => '', |
| 204 |
'schema_author_name' => '', |
| 205 |
), |
| 206 |
624 => array( |
| 207 |
'plugin_create_wp_sizes' => '', |
| 208 |
), |
| 209 |
627 => array( |
| 210 |
'plugin_cm_gp_name' => '', |
| 211 |
'plugin_cm_gp_label' => '', |
| 212 |
'plugin_cm_gp_enabled' => '', |
| 213 |
), |
| 214 |
629 => array( |
| 215 |
'seo_author_field' => '', |
| 216 |
'seo_publisher_url' => '', |
| 217 |
'plugin_cf_product_gender' => 'plugin_cf_product_target_gender', |
| 218 |
), |
| 219 |
631 => array( |
| 220 |
'tc_type_post' => 'tc_type_singular', |
| 221 |
), |
| 222 |
640 => array( |
| 223 |
'add_meta_property_product:sku' => '', |
| 224 |
), |
| 225 |
641 => array( |
| 226 |
'plugin_hide_pro' => '', |
| 227 |
), |
| 228 |
649 => array( |
| 229 |
'plugin_cf_product_ean' => 'plugin_cf_product_gtin13', |
| 230 |
), |
| 231 |
650 => array( |
| 232 |
'plugin_product_attr_volume' => 'plugin_attr_product_fluid_volume_value', |
| 233 |
'plugin_cf_product_volume' => 'plugin_cf_product_fluid_volume_value', |
| 234 |
), |
| 235 |
651 => array( |
| 236 |
'plugin_honor_force_ssl' => '', |
| 237 |
), |
| 238 |
654 => array( |
| 239 |
'plugin_json_data_cache_exp' => '', |
| 240 |
), |
| 241 |
656 => array( |
| 242 |
'og_vid_https' => '', |
| 243 |
), |
| 244 |
667 => array( |
| 245 |
'schema_add_noscript' => '', |
| 246 |
'schema_article_amp1x1_img_width' => 'schema_1x1_img_width', |
| 247 |
'schema_article_amp1x1_img_height' => 'schema_1x1_img_height', |
| 248 |
'schema_article_amp1x1_img_crop' => 'schema_1x1_img_crop', |
| 249 |
'schema_article_amp1x1_img_crop_x' => 'schema_1x1_img_crop_x', |
| 250 |
'schema_article_amp1x1_img_crop_y' => 'schema_1x1_img_crop_y', |
| 251 |
'schema_article_amp4x3_img_width' => 'schema_4x3_img_width', |
| 252 |
'schema_article_amp4x3_img_height' => 'schema_4x3_img_height', |
| 253 |
'schema_article_amp4x3_img_crop' => 'schema_4x3_img_crop', |
| 254 |
'schema_article_amp4x3_img_crop_x' => 'schema_4x3_img_crop_x', |
| 255 |
'schema_article_amp4x3_img_crop_y' => 'schema_4x3_img_crop_y', |
| 256 |
'schema_article_amp16x9_img_width' => 'schema_16x9_img_width', |
| 257 |
'schema_article_amp16x9_img_height' => 'schema_16x9_img_height', |
| 258 |
'schema_article_amp16x9_img_crop' => 'schema_16x9_img_crop', |
| 259 |
'schema_article_amp16x9_img_crop_x' => 'schema_16x9_img_crop_x', |
| 260 |
'schema_article_amp16x9_img_crop_y' => 'schema_16x9_img_crop_y', |
| 261 |
), |
| 262 |
671 => array( |
| 263 |
'p_dom_verify' => 'pin_site_verify', |
| 264 |
), |
| 265 |
673 => array( |
| 266 |
'add_link_itemprop_author.url' => '', |
| 267 |
'add_link_itemprop_author.image' => '', |
| 268 |
'add_link_itemprop_contributor.url' => '', |
| 269 |
'add_link_itemprop_contributor.image' => '', |
| 270 |
'add_link_itemprop_image.url' => '', |
| 271 |
'add_meta_itemprop_email' => '', |
| 272 |
'add_meta_itemprop_image.width' => '', |
| 273 |
'add_meta_itemprop_image.height' => '', |
| 274 |
'add_meta_itemprop_publisher.name' => '', |
| 275 |
'add_meta_itemprop_author.name' => '', |
| 276 |
'add_meta_itemprop_author.description' => '', |
| 277 |
'add_meta_itemprop_contributor.name' => '', |
| 278 |
'add_meta_itemprop_contributor.description' => '', |
| 279 |
'add_meta_itemprop_openinghoursspecification.dayofweek' => '', |
| 280 |
'add_meta_itemprop_openinghoursspecification.opens' => '', |
| 281 |
'add_meta_itemprop_openinghoursspecification.closes' => '', |
| 282 |
'add_meta_itemprop_openinghoursspecification.validfrom' => '', |
| 283 |
'add_meta_itemprop_openinghoursspecification.validthrough' => '', |
| 284 |
'add_meta_itemprop_startdate' => '', |
| 285 |
'add_meta_itemprop_enddate' => '', |
| 286 |
'add_meta_itemprop_location' => '', |
| 287 |
'add_meta_itemprop_preptime' => '', |
| 288 |
'add_meta_itemprop_cooktime' => '', |
| 289 |
'add_meta_itemprop_totaltime' => '', |
| 290 |
'add_meta_itemprop_recipeyield' => '', |
| 291 |
'add_meta_itemprop_recipeingredient' => '', |
| 292 |
'add_meta_itemprop_recipeinstructions' => '', |
| 293 |
), |
| 294 |
674 => array( |
| 295 |
'instgram_publisher_url' => 'instagram_publisher_url', |
| 296 |
), |
| 297 |
692 => array( |
| 298 |
'plugin_cf_product_mpn' => 'plugin_cf_product_mfr_part_no', |
| 299 |
'plugin_cf_product_sku' => 'plugin_cf_product_retailer_part_no', |
| 300 |
'plugin_product_attr_mpn' => 'plugin_attr_product_mfr_part_no', |
| 301 |
), |
| 302 |
700 => array( |
| 303 |
'og_art_section' => 'schema_def_article_section', |
| 304 |
'plugin_topics_cache_exp' => '', |
| 305 |
), |
| 306 |
701 => array( |
| 307 |
'og_def_article_topic' => 'schema_def_article_section', |
| 308 |
), |
| 309 |
703 => array( |
| 310 |
'plugin_clear_all_refresh' => '', |
| 311 |
), |
| 312 |
708 => array( |
| 313 |
'plugin_bitly_login' => '', |
| 314 |
'plugin_bitly_api_key' => '', |
| 315 |
), |
| 316 |
711 => array( |
| 317 |
'plugin_term_title_prefix' => '', |
| 318 |
), |
| 319 |
712 => array( |
| 320 |
'add_meta_name_weibo:article:create_at' => '', |
| 321 |
'add_meta_name_weibo:article:update_at' => '', |
| 322 |
), |
| 323 |
715 => array( |
| 324 |
'schema_type_for_home_blog' => 'schema_type_for_home_posts', |
| 325 |
'schema_type_for_home_index' => 'schema_type_for_home_posts', |
| 326 |
'og_type_for_home_blog' => 'og_type_for_home_posts', |
| 327 |
'og_type_for_home_index' => 'og_type_for_home_posts', |
| 328 |
), |
| 329 |
718 => array( |
| 330 |
'plugin_list_cache_exp' => '', |
| 331 |
), |
| 332 |
722 => array( |
| 333 |
'plugin_add_to_term' => '', |
| 334 |
'plugin_add_to_user' => 'plugin_add_to_user_page', |
| 335 |
), |
| 336 |
744 => array( |
| 337 |
'schema_banner_url' => 'site_org_banner_url', |
| 338 |
'schema_home_person_id' => 'site_pub_person_id', |
| 339 |
'schema_logo_url' => 'site_org_logo_url', |
| 340 |
'site_place_id' => 'site_org_place_id', |
| 341 |
), |
| 342 |
748 => array( |
| 343 |
'schema_article_img_width' => '', |
| 344 |
'schema_article_img_height' => '', |
| 345 |
'schema_article_img_crop' => '', |
| 346 |
'schema_article_img_crop_x' => '', |
| 347 |
'schema_article_img_crop_y' => '', |
| 348 |
'schema_article_1_1_img_width' => 'schema_1x1_img_width', |
| 349 |
'schema_article_1_1_img_height' => 'schema_1x1_img_height', |
| 350 |
'schema_article_1_1_img_crop' => 'schema_1x1_img_crop', |
| 351 |
'schema_article_1_1_img_crop_x' => 'schema_1x1_img_crop_x', |
| 352 |
'schema_article_1_1_img_crop_y' => 'schema_1x1_img_crop_y', |
| 353 |
'schema_article_4_3_img_width' => 'schema_4x3_img_width', |
| 354 |
'schema_article_4_3_img_height' => 'schema_4x3_img_height', |
| 355 |
'schema_article_4_3_img_crop' => 'schema_4x3_img_crop', |
| 356 |
'schema_article_4_3_img_crop_x' => 'schema_4x3_img_crop_x', |
| 357 |
'schema_article_4_3_img_crop_y' => 'schema_4x3_img_crop_y', |
| 358 |
'schema_article_16_9_img_width' => 'schema_16x9_img_width', |
| 359 |
'schema_article_16_9_img_height' => 'schema_16x9_img_height', |
| 360 |
'schema_article_16_9_img_crop' => 'schema_16x9_img_crop', |
| 361 |
'schema_article_16_9_img_crop_x' => 'schema_16x9_img_crop_x', |
| 362 |
'schema_article_16_9_img_crop_y' => 'schema_16x9_img_crop_y', |
| 363 |
'schema_img_width' => '', |
| 364 |
'schema_img_height' => '', |
| 365 |
'schema_img_crop' => '', |
| 366 |
'schema_img_crop_x' => '', |
| 367 |
'schema_img_crop_y' => '', |
| 368 |
), |
| 369 |
751 => array( |
| 370 |
'og_type_for_wpsc-product' => '', |
| 371 |
'plugin_add_to_wpsc-product' => '', |
| 372 |
'schema_type_for_wpsc-product' => '', |
| 373 |
), |
| 374 |
752 => array( |
| 375 |
'plugin_clear_on_save' => '', |
| 376 |
), |
| 377 |
768 => array( |
| 378 |
'plugin_def_currency' => 'og_def_currency', |
| 379 |
), |
| 380 |
772 => array( |
| 381 |
'site_url' => 'site_home_url', |
| 382 |
), |
| 383 |
773 => array( |
| 384 |
'plugin_debug' => 'plugin_debug_html', |
| 385 |
), |
| 386 |
784 => array( |
| 387 |
'schema_1_1_img_width' => 'schema_1x1_img_width', |
| 388 |
'schema_1_1_img_height' => 'schema_1x1_img_height', |
| 389 |
'schema_1_1_img_crop' => 'schema_1x1_img_crop', |
| 390 |
'schema_1_1_img_crop_x' => 'schema_1x1_img_crop_x', |
| 391 |
'schema_1_1_img_crop_y' => 'schema_1x1_img_crop_y', |
| 392 |
'schema_4_3_img_width' => 'schema_4x3_img_width', |
| 393 |
'schema_4_3_img_height' => 'schema_4x3_img_height', |
| 394 |
'schema_4_3_img_crop' => 'schema_4x3_img_crop', |
| 395 |
'schema_4_3_img_crop_x' => 'schema_4x3_img_crop_x', |
| 396 |
'schema_4_3_img_crop_y' => 'schema_4x3_img_crop_y', |
| 397 |
'schema_16_9_img_width' => 'schema_16x9_img_width', |
| 398 |
'schema_16_9_img_height' => 'schema_16x9_img_height', |
| 399 |
'schema_16_9_img_crop' => 'schema_16x9_img_crop', |
| 400 |
'schema_16_9_img_crop_x' => 'schema_16x9_img_crop_x', |
| 401 |
'schema_16_9_img_crop_y' => 'schema_16x9_img_crop_y', |
| 402 |
), |
| 403 |
786 => array( |
| 404 |
'og_def_img_id_pre' => '', |
| 405 |
), |
| 406 |
795 => array( |
| 407 |
'plugin_clear_on_activate' => '', |
| 408 |
'plugin_clear_on_deactivate' => '', |
| 409 |
'plugin_add_to_shop_coupon' => '', |
| 410 |
'plugin_add_to_shop_order' => '', |
| 411 |
), |
| 412 |
797 => array( |
| 413 |
'plugin_vidinfo_cache_exp' => '', |
| 414 |
'plugin_shopperapproved_num_max' => 'plugin_ratings_reviews_num_max', |
| 415 |
'plugin_shopperapproved_age_max' => 'plugin_ratings_reviews_months_max', |
| 416 |
'plugin_shopperapproved_for_download' => 'plugin_ratings_reviews_for_download', |
| 417 |
'plugin_shopperapproved_for_product' => 'plugin_ratings_reviews_for_product', |
| 418 |
), |
| 419 |
798 => array( |
| 420 |
'og_author_field' => '', |
| 421 |
), |
| 422 |
800 => array( |
| 423 |
'plugin_apiresp_cache_exp' => '', |
| 424 |
'plugin_cache_attach_page' => '', |
| 425 |
'plugin_content_cache_exp' => '', |
| 426 |
'plugin_head_cache_exp' => '', |
| 427 |
'plugin_imgsize_cache_exp' => '', |
| 428 |
'plugin_select_cache_exp' => '', |
| 429 |
'plugin_short_url_cache_exp' => '', |
| 430 |
'plugin_types_cache_exp' => '', |
| 431 |
), |
| 432 |
801 => array( |
| 433 |
'fb_admins' => '', |
| 434 |
'plugin_p_strip' => '', |
| 435 |
'plugin_use_img_alt' => '', |
| 436 |
), |
| 437 |
811 => array( |
| 438 |
'plm_def_country' => 'og_def_country', |
| 439 |
'seo_author_name' => '', |
| 440 |
), |
| 441 |
814 => array( |
| 442 |
'add_5_star_rating' => '', |
| 443 |
'plugin_col_title_width' => '', |
| 444 |
'plugin_col_title_width_max' => '', |
| 445 |
'plugin_col_def_width' => '', |
| 446 |
'plugin_col_def_width_max' => '', |
| 447 |
), |
| 448 |
815 => array( |
| 449 |
'p_site_verify' => 'pin_site_verify', |
| 450 |
'p_publisher_url' => 'pin_publisher_url', |
| 451 |
'p_add_nopin_header_img_tag' => 'pin_add_nopin_header_img_tag', |
| 452 |
'p_add_nopin_media_img_tag' => 'pin_add_nopin_media_img_tag', |
| 453 |
'p_add_img_html' => 'pin_add_img_html', |
| 454 |
'p_img_width' => 'pin_img_width', |
| 455 |
'p_img_height' => 'pin_img_height', |
| 456 |
'p_img_crop' => 'pin_img_crop', |
| 457 |
'p_img_crop_x' => 'pin_img_crop_x', |
| 458 |
'p_img_crop_y' => 'pin_img_crop_y', |
| 459 |
'p_img_desc_max_len' => '', |
| 460 |
'p_img_desc_warn_len' => '', |
| 461 |
), |
| 462 |
816 => array( |
| 463 |
'add_link_itemprop_url' => '', |
| 464 |
'add_link_itemprop_image' => '', |
| 465 |
'add_link_itemprop_thumbnailurl' => '', |
| 466 |
'add_link_itemprop_hasmenu' => '', |
| 467 |
'add_meta_itemprop_name' => '', |
| 468 |
'add_meta_itemprop_alternatename' => '', |
| 469 |
'add_meta_itemprop_description' => '', |
| 470 |
'add_meta_itemprop_aggregaterating.ratingvalue' => '', |
| 471 |
'add_meta_itemprop_aggregaterating.ratingcount' => '', |
| 472 |
'add_meta_itemprop_aggregaterating.worstrating' => '', |
| 473 |
'add_meta_itemprop_aggregaterating.bestrating' => '', |
| 474 |
'add_meta_itemprop_aggregaterating.reviewcount' => '', |
| 475 |
'add_meta_itemprop_address' => '', |
| 476 |
'add_meta_itemprop_telephone' => '', |
| 477 |
'add_meta_itemprop_currenciesaccepted' => '', |
| 478 |
'add_meta_itemprop_paymentaccepted' => '', |
| 479 |
'add_meta_itemprop_pricerange' => '', |
| 480 |
'add_meta_itemprop_acceptsreservations' => '', |
| 481 |
'add_meta_itemprop_servescuisine' => '', |
| 482 |
), |
| 483 |
831 => array( |
| 484 |
'plugin_clear_post_terms' => '', |
| 485 |
'plugin_clear_for_comment' => '', |
| 486 |
), |
| 487 |
832 => array( |
| 488 |
'upscale_img_max' => 'upscale_pct_max', |
| 489 |
), |
| 490 |
846 => array( |
| 491 |
'plugin_schema_type_col_post' => '', |
| 492 |
'plugin_schema_type_col_term' => '', |
| 493 |
'plugin_schema_type_col_user' => '', |
| 494 |
'plugin_og_type_col_post' => '', |
| 495 |
'plugin_og_type_col_term' => '', |
| 496 |
'plugin_og_type_col_user' => '', |
| 497 |
'plugin_og_img_col_post' => '', |
| 498 |
'plugin_og_img_col_term' => '', |
| 499 |
'plugin_og_img_col_user' => '', |
| 500 |
'plugin_og_desc_col_post' => '', |
| 501 |
'plugin_og_desc_col_term' => '', |
| 502 |
'plugin_og_desc_col_user' => '', |
| 503 |
), |
| 504 |
853 => array( |
| 505 |
'plugin_wpseo_social_meta' => 'plugin_import_wpseo_meta', |
| 506 |
'plugin_wpseo_show_import' => '', |
| 507 |
), |
| 508 |
864 => array( |
| 509 |
'og_type_for_post_archive' => '', |
| 510 |
'schema_type_for_post_archive' => '', |
| 511 |
'fb_author_field' => '', |
| 512 |
), |
| 513 |
870 => array( |
| 514 |
'plugin_checksum' => 'checksum', |
| 515 |
'plugin_filter_title' => '', |
| 516 |
'plugin_document_title' => '', |
| 517 |
'plugin_seo_title_part' => '', |
| 518 |
), |
| 519 |
877 => array( |
| 520 |
'seo_title_max_len' => '', |
| 521 |
'seo_desc_max_len' => '', |
| 522 |
'og_title_max_len' => '', |
| 523 |
'og_title_warn_len' => '', |
| 524 |
'og_desc_max_len' => '', |
| 525 |
'og_desc_warn_len' => '', |
| 526 |
'pin_img_desc_max_len' => '', |
| 527 |
'pin_img_desc_warn_len' => '', |
| 528 |
'tc_title_max_len' => '', |
| 529 |
'tc_desc_max_len' => '', |
| 530 |
'schema_title_max_len' => '', |
| 531 |
'schema_desc_max_len' => '', |
| 532 |
'schema_text_max_len' => '', |
| 533 |
), |
| 534 |
881 => array( |
| 535 |
'og_type_for_elementor_library' => '', |
| 536 |
'schema_type_for_elementor_library' => '', |
| 537 |
'wpsm_sitemaps_for_elementor_library' => '', |
| 538 |
), |
| 539 |
891 => array( |
| 540 |
'plugin_show_validate_toolbar' => 'plugin_add_toolbar_validate', |
| 541 |
), |
| 542 |
898 => array( |
| 543 |
'home_url' => 'site_home_url', |
| 544 |
), |
| 545 |
914 => array( |
| 546 |
'og_def_product_category' => 'schema_def_product_category', |
| 547 |
'og_def_product_condition' => 'schema_def_product_condition', |
| 548 |
'og_def_product_price_type' => '', |
| 549 |
), |
| 550 |
920 => array( // Renamed for WPSSO Core v13.5.0. |
| 551 |
'og_def_article_section' => 'schema_def_article_section', |
| 552 |
), |
| 553 |
935 => array( // Renamed for WPSSO Core v14.0.0. |
| 554 |
'plugin_attr_product_adult_oriented' => 'plugin_attr_product_adult_type', |
| 555 |
'plugin_attr_product_size_type' => 'plugin_attr_product_size_group', |
| 556 |
'plugin_cf_product_adult_oriented' => 'plugin_cf_product_adult_type', |
| 557 |
'plugin_cf_product_size_type' => 'plugin_cf_product_size_group', |
| 558 |
'schema_def_product_adult_oriented' => 'schema_def_product_adult_type', |
| 559 |
), |
| 560 |
941 => array( // Renamed for WPSSO Core v14.2.0. |
| 561 |
'og_def_img_id_lib' => '', |
| 562 |
'plugin_inherit_custom' => 'plugin_inherit_images', |
| 563 |
), |
| 564 |
947 => array( |
| 565 |
'plugin_clear_short_urls' => '', |
| 566 |
), |
| 567 |
974 => array( |
| 568 |
'site_org_pub_principles_url' => '', |
| 569 |
'site_org_corrections_policy_url' => '', |
| 570 |
'site_org_diversity_policy_url' => '', |
| 571 |
'site_org_ethics_policy_url' => '', |
| 572 |
'site_org_feedback_policy_url' => '', |
| 573 |
'site_org_sources_policy_url' => '', |
| 574 |
), |
| 575 |
985 => array( |
| 576 |
'plugin_wpvideo_api' => 'plugin_media_wpvideoshortcode', |
| 577 |
'schema_add_text_prop' => 'schema_def_add_text_prop', |
| 578 |
'schema_aggr_offers' => 'schema_def_product_aggr_offers', |
| 579 |
), |
| 580 |
989 => array( |
| 581 |
'schema_type_for_attachment_audio' => '', |
| 582 |
'schema_type_for_attachment_image' => '', |
| 583 |
'schema_type_for_attachment_video' => '', |
| 584 |
), |
| 585 |
1001 => array( |
| 586 |
'plugin_ratings_reviews_age_max' => 'plugin_ratings_reviews_months_max', |
| 587 |
), |
| 588 |
1007 => array( |
| 589 |
'plugin_gravatar_api' => 'plugin_gravatar_image', |
| 590 |
'plugin_facebook_api' => 'plugin_media_facebook', |
| 591 |
'plugin_slideshare_api' => 'plugin_media_slideshare', |
| 592 |
'plugin_soundcloud_api' => 'plugin_media_soundcloud', |
| 593 |
'plugin_vimeo_api' => 'plugin_media_vimeo', |
| 594 |
'plugin_wistia_api' => 'plugin_media_wistia', |
| 595 |
'plugin_wpvideoblock_api' => 'plugin_media_wpvideoblock', |
| 596 |
'plugin_wpvideoshortcode_api' => 'plugin_media_wpvideoshortcode', |
| 597 |
'plugin_youtube_api' => 'plugin_media_youtube', |
| 598 |
), |
| 599 |
1012 => array( |
| 600 |
'plugin_add_submenu_am-general' => '', |
| 601 |
'plugin_add_submenu_bc-general' => '', |
| 602 |
'plugin_add_submenu_dashboard' => '', |
| 603 |
'plugin_add_submenu_faq-general' => '', |
| 604 |
'plugin_add_submenu_gmf-general' => '', |
| 605 |
'plugin_add_submenu_rar-general' => '', |
| 606 |
'plugin_add_submenu_tie-general' => '', |
| 607 |
'plugin_add_submenu_wcmd-general' => '', |
| 608 |
'plugin_add_submenu_wcsdt-general' => '', |
| 609 |
'plugin_add_submenu_wpsm-general' => '', |
| 610 |
), |
| 611 |
1020 => array( |
| 612 |
'plugin_wpssoam_tid' => '', |
| 613 |
'plugin_wpssojson_tid' => '', |
| 614 |
'plugin_wpssoorg_tid' => '', |
| 615 |
'plugin_wpssoplm_tid' => '', |
| 616 |
'plugin_wpssorrssb_tid' => '', |
| 617 |
'plugin_wpssotie_tid' => '', |
| 618 |
'plugin_wpsso_version' => '', |
| 619 |
'plugin_wpssoafs_version' => '', |
| 620 |
'plugin_wpssoam_version' => '', |
| 621 |
'plugin_wpssobc_version' => '', |
| 622 |
'plugin_wpssofaq_version' => '', |
| 623 |
'plugin_wpssogmf_version' => '', |
| 624 |
'plugin_wpssoipm_version' => '', |
| 625 |
'plugin_wpssojson_version' => '', |
| 626 |
'plugin_wpssoopm_version' => '', |
| 627 |
'plugin_wpssoorg_version' => '', |
| 628 |
'plugin_wpssoplm_version' => '', |
| 629 |
'plugin_wpssorar_version' => '', |
| 630 |
'plugin_wpssorest_version' => '', |
| 631 |
'plugin_wpssorrssb_version' => '', |
| 632 |
'plugin_wpssossc_version' => '', |
| 633 |
'plugin_wpssossm_version' => '', |
| 634 |
'plugin_wpssotie_version' => '', |
| 635 |
'plugin_wpssoul_version' => '', |
| 636 |
'plugin_wpssoum_version' => '', |
| 637 |
'plugin_wpssowcmd_version' => '', |
| 638 |
'plugin_wpssowcsdt_version' => '', |
| 639 |
'plugin_wpssowpsm_version' => '', |
| 640 |
), |
| 641 |
1027 => array( |
| 642 |
'plugin_og_type_col_attachment' => '', |
| 643 |
'plugin_og_type_col_download' => '', |
| 644 |
'plugin_og_type_col_page' => '', |
| 645 |
'plugin_og_type_col_post' => '', |
| 646 |
'plugin_og_type_col_product' => '', |
| 647 |
'plugin_og_type_col_tax_category' => '', |
| 648 |
'plugin_og_type_col_tax_faq_category' => '', |
| 649 |
'plugin_og_type_col_tax_link_category' => '', |
| 650 |
'plugin_og_type_col_tax_post_tag' => '', |
| 651 |
'plugin_og_type_col_tax_product_cat' => '', |
| 652 |
'plugin_og_type_col_tax_product_tag' => '', |
| 653 |
'plugin_og_type_col_tax_tribe_events_cat' => '', |
| 654 |
'plugin_og_type_col_user_page' => '', |
| 655 |
'plugin_schema_type_col_attachment' => '', |
| 656 |
'plugin_schema_type_col_download' => '', |
| 657 |
'plugin_schema_type_col_page' => '', |
| 658 |
'plugin_schema_type_col_post' => '', |
| 659 |
'plugin_schema_type_col_product' => '', |
| 660 |
'plugin_schema_type_col_tax_category' => '', |
| 661 |
'plugin_schema_type_col_tax_faq_category' => '', |
| 662 |
'plugin_schema_type_col_tax_link_category' => '', |
| 663 |
'plugin_schema_type_col_tax_post_tag' => '', |
| 664 |
'plugin_schema_type_col_tax_product_cat' => '', |
| 665 |
'plugin_schema_type_col_tax_product_tag' => '', |
| 666 |
'plugin_schema_type_col_tax_tribe_events_cat' => '', |
| 667 |
'plugin_schema_type_col_user_page' => '', |
| 668 |
), |
| 669 |
1035 => array( |
| 670 |
'schema_def_product_price_type' => '', |
| 671 |
), |
| 672 |
), |
| 673 |
); |
| 674 |
|
| 675 |
public function __construct( &$plugin ) { |
| 676 |
|
| 677 |
$this->p =& $plugin; |
| 678 |
|
| 679 |
if ( $this->p->debug->enabled ) { |
| 680 |
|
| 681 |
$this->p->debug->mark(); |
| 682 |
} |
| 683 |
} |
| 684 |
|
| 685 |
public function options( $opts_name, $opts = array(), $defs = array(), $network = false ) { |
| 686 |
|
| 687 |
if ( constant( 'WPSSO_OPTIONS_NAME' ) === $opts_name ) { |
| 688 |
|
| 689 |
$is_site_options = false; |
| 690 |
|
| 691 |
} elseif ( constant( 'WPSSO_SITE_OPTIONS_NAME' ) === $opts_name ) { |
| 692 |
|
| 693 |
$is_site_options = true; |
| 694 |
|
| 695 |
} else return $opts; // Nothing to do. |
| 696 |
|
| 697 |
/* |
| 698 |
* Get the current options version number for checks to follow. |
| 699 |
*/ |
| 700 |
$prev_version = $this->p->opt->get_version( $opts, 'wpsso' ); // Returns 'opt_version'. |
| 701 |
|
| 702 |
/* |
| 703 |
* Maybe renamed some option keys. |
| 704 |
*/ |
| 705 |
$version_keys = $is_site_options ? |
| 706 |
apply_filters( 'wpsso_rename_site_options_keys', self::$rename_options ) : // Network options filter. |
| 707 |
apply_filters( 'wpsso_rename_options_keys', self::$rename_options ); |
| 708 |
|
| 709 |
$opts = $this->p->util->rename_options_by_ext( $opts, $version_keys ); |
| 710 |
|
| 711 |
if ( $prev_version > 0 && $prev_version <= 270 ) { |
| 712 |
|
| 713 |
foreach ( SucomUtilOptions::get_opts_begin( $opts, 'inc_' ) as $key => $val ) { |
| 714 |
|
| 715 |
$new_key = ''; |
| 716 |
|
| 717 |
switch ( $key ) { |
| 718 |
|
| 719 |
case ( preg_match( '/^inc_(description|twitter:)/', $key ) ? true : false ): |
| 720 |
|
| 721 |
$new_key = preg_replace( '/^inc_/', 'add_meta_name_', $key ); |
| 722 |
|
| 723 |
break; |
| 724 |
|
| 725 |
default: |
| 726 |
|
| 727 |
$new_key = preg_replace( '/^inc_/', 'add_meta_property_', $key ); |
| 728 |
|
| 729 |
break; |
| 730 |
|
| 731 |
} |
| 732 |
|
| 733 |
if ( ! empty( $new_key ) ) { |
| 734 |
|
| 735 |
$opts[ $new_key ] = $val; |
| 736 |
} |
| 737 |
|
| 738 |
unset( $opts[ $key ] ); |
| 739 |
} |
| 740 |
} |
| 741 |
|
| 742 |
if ( $prev_version > 0 && $prev_version <= 296 ) { |
| 743 |
|
| 744 |
if ( empty( $opts[ 'plugin_min_shorten' ] ) || $opts[ 'plugin_min_shorten' ] < 22 ) { |
| 745 |
|
| 746 |
$opts[ 'plugin_min_shorten' ] = 22; |
| 747 |
} |
| 748 |
} |
| 749 |
|
| 750 |
if ( $prev_version > 0 && $prev_version <= 557 ) { |
| 751 |
|
| 752 |
if ( isset( $opts[ 'plugin_cm_fb_label' ] ) && $opts[ 'plugin_cm_fb_label' ] === 'Facebook URL' ) { |
| 753 |
|
| 754 |
$opts[ 'plugin_cm_fb_label' ] = 'Facebook User URL'; |
| 755 |
} |
| 756 |
|
| 757 |
SucomUtilOptions::transl_key_values( '/^plugin_(cm_.*_label|.*_prefix)$/', $this->p->options, 'wpsso' ); |
| 758 |
} |
| 759 |
|
| 760 |
if ( $prev_version > 0 && $prev_version <= 564 ) { |
| 761 |
|
| 762 |
if ( isset( $opts[ 'schema_type_for_job_listing' ] ) && $opts[ 'schema_type_for_job_listing' ] === 'webpage' ) { |
| 763 |
|
| 764 |
$opts[ 'schema_type_for_job_listing' ] = 'job.posting'; |
| 765 |
} |
| 766 |
} |
| 767 |
|
| 768 |
/* |
| 769 |
* Enable og:image and og:video meta tags, and disable the og:image:url and og:video:url meta tags, |
| 770 |
* which are functionally identical. |
| 771 |
*/ |
| 772 |
if ( $prev_version > 0 && $prev_version <= 591 ) { |
| 773 |
|
| 774 |
foreach ( array( 'og:image', 'og:video' ) as $mt_name ) { |
| 775 |
|
| 776 |
$opts[ 'add_meta_property_' . $mt_name] = 1; |
| 777 |
$opts[ 'add_meta_property_' . $mt_name . ':url' ] = 0; |
| 778 |
} |
| 779 |
} |
| 780 |
|
| 781 |
/* |
| 782 |
* Remove the 'person' role from all subscribers. |
| 783 |
*/ |
| 784 |
if ( $prev_version > 0 && $prev_version <= 599 ) { |
| 785 |
|
| 786 |
if ( empty( $this->p->options[ 'plugin_new_user_is_person' ] ) ) { |
| 787 |
|
| 788 |
while ( $result = SucomUtilWP::get_roles_users_ids( $roles = array( 'subscriber' ), $blog_id = null, $limit = 1000 ) ) { |
| 789 |
|
| 790 |
foreach ( $result as $user_id ) { |
| 791 |
|
| 792 |
$user_obj = get_user_by( 'ID', $user_id ); |
| 793 |
|
| 794 |
$user_obj->remove_role( 'person' ); |
| 795 |
} |
| 796 |
} |
| 797 |
} |
| 798 |
} |
| 799 |
|
| 800 |
/* |
| 801 |
* The Google URL Shortener was discontinued by Google in March 2018. |
| 802 |
*/ |
| 803 |
if ( $prev_version > 0 && $prev_version <= 614 ) { |
| 804 |
|
| 805 |
if ( isset( $this->p->options[ 'plugin_shortener' ] ) ) { |
| 806 |
|
| 807 |
if ( 'googl' === $this->p->options[ 'plugin_shortener' ] || |
| 808 |
'google-url-shortener' === $this->p->options[ 'plugin_shortener' ] ) { |
| 809 |
|
| 810 |
$this->p->options[ 'plugin_shortener' ] = 'none'; |
| 811 |
} |
| 812 |
} |
| 813 |
} |
| 814 |
|
| 815 |
if ( $prev_version > 0 && $prev_version <= 619 ) { |
| 816 |
|
| 817 |
foreach ( array( 'og:image', 'og:video' ) as $mt_name ) { |
| 818 |
|
| 819 |
$opts[ 'add_meta_property_' . $mt_name . ':secure_url' ] = 0; |
| 820 |
$opts[ 'add_meta_property_' . $mt_name . ':url' ] = 0; |
| 821 |
$opts[ 'add_meta_property_' . $mt_name ] = 1; |
| 822 |
} |
| 823 |
} |
| 824 |
|
| 825 |
if ( $prev_version > 0 && $prev_version <= 625 ) { |
| 826 |
|
| 827 |
$opts[ 'plugin_attr_product_brand' ] = 'Brand'; |
| 828 |
$opts[ 'plugin_attr_product_color' ] = 'Color'; |
| 829 |
$opts[ 'plugin_attr_product_condition' ] = 'Condition'; |
| 830 |
$opts[ 'plugin_attr_product_gtin14' ] = 'GTIN-14'; |
| 831 |
$opts[ 'plugin_attr_product_gtin13' ] = 'GTIN-13'; |
| 832 |
$opts[ 'plugin_attr_product_gtin12' ] = 'GTIN-12'; |
| 833 |
$opts[ 'plugin_attr_product_gtin8' ] = 'GTIN-8'; |
| 834 |
$opts[ 'plugin_attr_product_gtin' ] = 'GTIN'; |
| 835 |
$opts[ 'plugin_attr_product_isbn' ] = 'ISBN'; |
| 836 |
$opts[ 'plugin_attr_product_material' ] = 'Material'; |
| 837 |
$opts[ 'plugin_attr_product_size' ] = 'Size'; |
| 838 |
} |
| 839 |
|
| 840 |
/* |
| 841 |
* All product meta tags are not enabled by default. |
| 842 |
*/ |
| 843 |
if ( $prev_version > 0 && $prev_version <= 637 ) { |
| 844 |
|
| 845 |
foreach ( SucomUtilOptions::get_opts_begin( $opts, 'add_meta_property_product:' ) as $key => $val ) { |
| 846 |
|
| 847 |
$opts[ $key ] = 1; |
| 848 |
} |
| 849 |
} |
| 850 |
|
| 851 |
if ( $prev_version > 0 && $prev_version <= 744 ) { |
| 852 |
|
| 853 |
if ( ! empty( $opts[ 'schema_add_home_organization' ] ) ) { |
| 854 |
|
| 855 |
$opts[ 'site_pub_schema_type' ] = 'organization'; |
| 856 |
|
| 857 |
} elseif ( ! empty( $opts[ 'schema_add_home_person' ] ) ) { |
| 858 |
|
| 859 |
$opts[ 'site_pub_schema_type' ] = 'person'; |
| 860 |
} |
| 861 |
|
| 862 |
unset( $opts[ 'schema_add_home_organization' ] ); |
| 863 |
|
| 864 |
unset( $opts[ 'schema_add_home_person' ] ); |
| 865 |
} |
| 866 |
|
| 867 |
/* |
| 868 |
* Remove the options from deprecated add-ons. |
| 869 |
*/ |
| 870 |
if ( $prev_version > 0 && $prev_version <= 765 ) { |
| 871 |
|
| 872 |
if ( ! class_exists( 'WpssoSsb' ) ) { // Make sure the deprecated add-on is not active. |
| 873 |
|
| 874 |
unset( |
| 875 |
$opts[ 'buttons_preset_ssb-content' ], |
| 876 |
$opts[ 'buttons_preset_ssb-excerpt' ], |
| 877 |
$opts[ 'buttons_preset_ssb-sidebar' ], |
| 878 |
$opts[ 'buttons_preset_ssb-shortcode' ], |
| 879 |
$opts[ 'buttons_preset_ssb-widget' ], |
| 880 |
$opts[ 'buttons_css_ssb-content' ], |
| 881 |
$opts[ 'buttons_css_ssb-excerpt' ], |
| 882 |
$opts[ 'buttons_css_ssb-sharing' ], |
| 883 |
$opts[ 'buttons_css_ssb-shortcode' ], |
| 884 |
$opts[ 'buttons_css_ssb-sidebar' ], |
| 885 |
$opts[ 'buttons_css_ssb-widget' ], |
| 886 |
$opts[ 'buttons_js_ssb-sidebar' ], |
| 887 |
$opts[ 'email_ssb_html' ], |
| 888 |
$opts[ 'plugin_social_file_cache_exp' ], |
| 889 |
$opts[ 'wa_ssb_html' ] |
| 890 |
); |
| 891 |
} |
| 892 |
|
| 893 |
if ( ! class_exists( 'WpssoTaq' ) ) { // Make sure the deprecated add-on is not active. |
| 894 |
|
| 895 |
unset( |
| 896 |
$opts[ 'taq_add_via' ], |
| 897 |
$opts[ 'taq_rec_author' ], |
| 898 |
$opts[ 'taq_link_text' ], |
| 899 |
$opts[ 'taq_add_button' ], |
| 900 |
$opts[ 'taq_use_style' ], |
| 901 |
$opts[ 'taq_use_script' ], |
| 902 |
$opts[ 'taq_popup_width' ], |
| 903 |
$opts[ 'taq_popup_height' ] |
| 904 |
); |
| 905 |
} |
| 906 |
} |
| 907 |
|
| 908 |
/* |
| 909 |
* Update the Facebook App ID to its default value. |
| 910 |
*/ |
| 911 |
if ( $prev_version > 0 && $prev_version <= 778 ) { |
| 912 |
|
| 913 |
if ( empty( $opts[ 'fb_app_id' ] ) ) { |
| 914 |
|
| 915 |
$opts[ 'fb_app_id' ] = '966242223397117'; |
| 916 |
} |
| 917 |
} |
| 918 |
|
| 919 |
/* |
| 920 |
* Fix default publisher. |
| 921 |
*/ |
| 922 |
if ( $prev_version > 0 && $prev_version <= 827 ) { |
| 923 |
|
| 924 |
if ( 'none' === $opts[ 'schema_def_pub_org_id' ] && 'none' === $opts[ 'schema_def_pub_person_id' ] ) { |
| 925 |
|
| 926 |
switch ( $opts[ 'site_pub_schema_type' ] ) { |
| 927 |
|
| 928 |
case 'person': |
| 929 |
|
| 930 |
$opts[ 'schema_def_pub_org_id' ] = 'none'; |
| 931 |
$opts[ 'schema_def_pub_person_id' ] = $opts[ 'site_pub_person_id' ]; |
| 932 |
|
| 933 |
break; |
| 934 |
|
| 935 |
case 'organization': |
| 936 |
|
| 937 |
$opts[ 'schema_def_pub_org_id' ] = 'site'; |
| 938 |
$opts[ 'schema_def_pub_person_id' ] = 'none'; |
| 939 |
|
| 940 |
break; |
| 941 |
} |
| 942 |
} |
| 943 |
} |
| 944 |
|
| 945 |
/* |
| 946 |
* Rename 'plugin_sitemaps_for' options to 'wpsm_sitemaps_for' for the WPSSO WPSM add-on. |
| 947 |
*/ |
| 948 |
if ( $prev_version > 0 && $prev_version <= 834 ) { |
| 949 |
|
| 950 |
foreach ( SucomUtilOptions::get_opts_begin( $opts, 'plugin_sitemaps_for' ) as $key => $val ) { |
| 951 |
|
| 952 |
$new_key = preg_replace( '/^plugin_sitemaps_for/', 'wpsm_sitemaps_for', $key ); |
| 953 |
|
| 954 |
$opts[ $new_key ] = $val; |
| 955 |
|
| 956 |
unset( $opts[ $key ] ); |
| 957 |
} |
| 958 |
} |
| 959 |
|
| 960 |
if ( $prev_version > 0 && $prev_version <= 846 ) { |
| 961 |
|
| 962 |
$opts = SucomUtil::preg_grep_keys( '/^plugin_.*_col_.*$/', $opts, $invert = true ); |
| 963 |
} |
| 964 |
|
| 965 |
/* |
| 966 |
* If the X (Twitter) Card image sizes have not been changed from their old default values, then |
| 967 |
* update the options to the new default values. |
| 968 |
*/ |
| 969 |
if ( $prev_version > 0 && $prev_version <= 889 ) { |
| 970 |
|
| 971 |
if ( 1200 === $opts[ 'tc_sum_img_width' ] && 630 === $opts[ 'tc_sum_img_height' ] && $opts[ 'tc_sum_img_crop' ] && |
| 972 |
'center' === $opts[ 'tc_sum_img_crop_x' ] && 'center' === $opts[ 'tc_sum_img_crop_y' ] ) { |
| 973 |
|
| 974 |
$opts[ 'tc_sum_img_width' ] = 1200; |
| 975 |
$opts[ 'tc_sum_img_height' ] = 1200; |
| 976 |
$opts[ 'tc_sum_img_crop' ] = 1; |
| 977 |
$opts[ 'tc_sum_img_crop_x' ] = 'center'; |
| 978 |
$opts[ 'tc_sum_img_crop_y' ] = 'center'; |
| 979 |
} |
| 980 |
|
| 981 |
if ( 1200 === $opts[ 'tc_lrg_img_width' ] && 1800 === $opts[ 'tc_lrg_img_height' ] && ! $opts[ 'tc_lrg_img_crop' ] && |
| 982 |
'center' === $opts[ 'tc_lrg_img_crop_x' ] && 'center' === $opts[ 'tc_lrg_img_crop_y' ] ) { |
| 983 |
|
| 984 |
$opts[ 'tc_lrg_img_width' ] = 1200; |
| 985 |
$opts[ 'tc_lrg_img_height' ] = 628; |
| 986 |
$opts[ 'tc_lrg_img_crop' ] = 1; |
| 987 |
$opts[ 'tc_lrg_img_crop_x' ] = 'center'; |
| 988 |
$opts[ 'tc_lrg_img_crop_y' ] = 'center'; |
| 989 |
} |
| 990 |
} |
| 991 |
|
| 992 |
/* |
| 993 |
* The '%%term_title%%' inline variable no longer includes parent names. |
| 994 |
* |
| 995 |
* Replace the old '%%term_title%%' variable by '%%term_hierarchy%%'. |
| 996 |
*/ |
| 997 |
if ( $prev_version > 0 && $prev_version <= 925 ) { |
| 998 |
|
| 999 |
if ( ! empty( $opts[ 'plugin_term_page_title' ] ) ) { |
| 1000 |
|
| 1001 |
if ( '%%term_title%%' === $opts[ 'plugin_term_page_title' ] ) { |
| 1002 |
|
| 1003 |
$opts[ 'plugin_term_page_title' ] = '%%term_hierarchy%%'; |
| 1004 |
} |
| 1005 |
} |
| 1006 |
} |
| 1007 |
|
| 1008 |
if ( $prev_version > 0 && $prev_version <= 930 ) { |
| 1009 |
|
| 1010 |
$opts[ 'og_def_dimension_units' ] = $defs[ 'og_def_dimension_units' ]; |
| 1011 |
$opts[ 'og_def_weight_units' ] = $defs[ 'og_def_weight_units' ]; |
| 1012 |
$opts[ 'og_def_fluid_volume_units' ] = $defs[ 'og_def_fluid_volume_units' ]; |
| 1013 |
} |
| 1014 |
|
| 1015 |
if ( $prev_version > 0 && $prev_version <= 954 ) { |
| 1016 |
|
| 1017 |
if ( ! empty( $opts[ 'plugin_product_var_title' ] ) ) { |
| 1018 |
|
| 1019 |
if ( '%%var_title%% %%sep%% %%var_sku%%' === $opts[ 'plugin_product_var_title' ] ) { |
| 1020 |
|
| 1021 |
$opts[ 'plugin_product_var_title' ] = '%%var_title%% %%sep%% %%var_attrs%%'; |
| 1022 |
} |
| 1023 |
} |
| 1024 |
} |
| 1025 |
|
| 1026 |
if ( $prev_version > 0 && $prev_version <= 982 ) { |
| 1027 |
|
| 1028 |
if ( ! empty( $opts[ 'plugin_feed_title' ] ) ) { |
| 1029 |
|
| 1030 |
if ( '%%sitename%% %%sep%% RSS Feed' === $opts[ 'plugin_feed_title' ] ) { |
| 1031 |
|
| 1032 |
$opts[ 'plugin_feed_title' ] = '%%sitename%% RSS Feed'; |
| 1033 |
} |
| 1034 |
} |
| 1035 |
} |
| 1036 |
|
| 1037 |
if ( $prev_version > 0 && $prev_version <= 988 ) { |
| 1038 |
|
| 1039 |
if ( ! empty( $opts[ 'schema_type_for_attachment' ] ) ) { |
| 1040 |
|
| 1041 |
if ( 'media.object' === $opts[ 'schema_type_for_attachment' ] ) { |
| 1042 |
|
| 1043 |
$opts[ 'schema_type_for_attachment' ] = 'webpage'; |
| 1044 |
} |
| 1045 |
} |
| 1046 |
} |
| 1047 |
|
| 1048 |
if ( $prev_version > 0 && $prev_version <= 990 ) { |
| 1049 |
|
| 1050 |
$opts[ 'schema_def_add_text_prop' ] = 0; // Default is unchecked. |
| 1051 |
} |
| 1052 |
|
| 1053 |
if ( $prev_version > 0 && $prev_version <= 1030 ) { |
| 1054 |
|
| 1055 |
$notice_key = 'timed-notice-wpsso-plugin-review'; |
| 1056 |
|
| 1057 |
$this->p->notice->is_dismissed( $notice_key, $user_id = null, $force_expire = true ); |
| 1058 |
} |
| 1059 |
|
| 1060 |
if ( $prev_version > 0 && $prev_version <= 1036 ) { |
| 1061 |
|
| 1062 |
if ( empty( $opts[ 'plugin_cf_product_gtin' ] ) ) { |
| 1063 |
|
| 1064 |
$opts[ 'plugin_cf_product_gtin' ] = '_global_unique_id'; |
| 1065 |
} |
| 1066 |
} |
| 1067 |
|
| 1068 |
if ( $prev_version > 0 && $prev_version <= 1041 ) { |
| 1069 |
|
| 1070 |
if ( isset( $opts[ 'plugin_comment_review_title' ] ) ) { |
| 1071 |
|
| 1072 |
if ( 'Review by %%comment_author%% on %%comment_date%%' === $opts[ 'plugin_comment_review_title' ] ) { |
| 1073 |
|
| 1074 |
$opts[ 'plugin_comment_review_title' ] = 'Review by %%comment_author%%'; |
| 1075 |
} |
| 1076 |
} |
| 1077 |
} |
| 1078 |
|
| 1079 |
/* |
| 1080 |
* Check for schema type IDs to be renamed. |
| 1081 |
*/ |
| 1082 |
$schema_type_keys_preg = '/^(schema_type_.*|site_org_schema_type|org_schema_type|place_schema_type|plm_place_schema_type)(_[0-9]+)?$/'; |
| 1083 |
|
| 1084 |
foreach ( SucomUtil::preg_grep_keys( $schema_type_keys_preg, $opts ) as $key => $val ) { |
| 1085 |
|
| 1086 |
if ( ! empty( $this->p->cf[ 'head' ][ 'schema_renamed' ][ $val ] ) ) { |
| 1087 |
|
| 1088 |
$opts[ $key ] = $this->p->cf[ 'head' ][ 'schema_renamed' ][ $val ]; |
| 1089 |
} |
| 1090 |
} |
| 1091 |
|
| 1092 |
unset( $schema_type_keys_preg ); |
| 1093 |
|
| 1094 |
/* |
| 1095 |
* Make sure all the return policy, organization, person, and place IDs still exist. |
| 1096 |
*/ |
| 1097 |
$select_names = array( |
| 1098 |
'mrp' => $this->p->util->get_form_cache( 'mrp_names', $add_none = true ), |
| 1099 |
'org' => $this->p->util->get_form_cache( 'org_names', $add_none = true ), |
| 1100 |
'person' => $this->p->util->get_form_cache( 'person_names', $add_none = true ), |
| 1101 |
'place' => $this->p->util->get_form_cache( 'place_names', $add_none = true ), |
| 1102 |
); |
| 1103 |
|
| 1104 |
foreach ( array( |
| 1105 |
'site_pub_person_id' => 'person', |
| 1106 |
'schema_def_product_mrp' => 'mrp', |
| 1107 |
'schema_def_pub_org_id' => 'org', |
| 1108 |
'schema_def_prov_org_id' => 'org', |
| 1109 |
'schema_def_service_prov_org_id' => 'org', |
| 1110 |
'schema_def_fund_org_id' => 'org', |
| 1111 |
'schema_def_event_performer_org_id' => 'org', |
| 1112 |
'schema_def_event_organizer_org_id' => 'org', |
| 1113 |
'schema_def_event_fund_org_id' => 'org', |
| 1114 |
'schema_def_job_hiring_org_id' => 'org', |
| 1115 |
'schema_def_pub_person_id' => 'person', |
| 1116 |
'schema_def_prov_person_id' => 'person', |
| 1117 |
'schema_def_service_prov_person_id' => 'person', |
| 1118 |
'schema_def_fund_person_id' => 'person', |
| 1119 |
'schema_def_event_performer_person_id' => 'person', |
| 1120 |
'schema_def_event_organizer_person_id' => 'person', |
| 1121 |
'schema_def_event_fund_person_id' => 'person', |
| 1122 |
'schema_webpage_reviewed_by_person_id' => 'person', |
| 1123 |
'schema_def_event_location_id' => 'place', |
| 1124 |
'schema_def_job_location_id' => 'place', |
| 1125 |
) as $opt_key => $name_type ) { |
| 1126 |
|
| 1127 |
if ( isset( $opts[ $opt_key ] ) && ! isset( $select_names[ $name_type ][ $opts[ $opt_key ] ] ) ) { |
| 1128 |
|
| 1129 |
if ( isset( $defs[ $opt_key ] ) ) { |
| 1130 |
|
| 1131 |
$opts[ $opt_key ] = $defs[ $opt_key ]; |
| 1132 |
|
| 1133 |
} else unset( $opts[ $opt_key ] ); |
| 1134 |
} |
| 1135 |
} |
| 1136 |
|
| 1137 |
unset( $select_names ); |
| 1138 |
|
| 1139 |
/* |
| 1140 |
* Maybe add any new / missing options keys. |
| 1141 |
*/ |
| 1142 |
$opts = array_merge( $defs, $opts ); |
| 1143 |
|
| 1144 |
$opts = $is_site_options ? |
| 1145 |
apply_filters( 'wpsso_upgraded_site_options', $opts, $defs ) : |
| 1146 |
apply_filters( 'wpsso_upgraded_options', $opts, $defs ); |
| 1147 |
|
| 1148 |
/* |
| 1149 |
* The options array should not contain any numeric keys. |
| 1150 |
*/ |
| 1151 |
SucomUtil::unset_numeric_keys( $opts ); |
| 1152 |
|
| 1153 |
/* |
| 1154 |
* Refresh the schema types transient cache. |
| 1155 |
*/ |
| 1156 |
$this->p->schema->get_schema_types( $flatten = true, $read_cache = false ); |
| 1157 |
|
| 1158 |
return $opts; |
| 1159 |
} |
| 1160 |
} |
| 1161 |
} |
| 1162 |
|