Changeset 3103368
- Timestamp:
- 06/17/2024 05:29:40 AM (22 months ago)
- Location:
- realbig-media/trunk
- Files:
-
- 14 edited
-
README.MD (modified) (2 diffs)
-
README.txt (modified) (2 diffs)
-
RFWP_AdminPage.php (modified) (2 diffs)
-
RFWP_Amp.php (modified) (1 diff)
-
RFWP_Cache.php (modified) (1 diff)
-
RFWP_Utils.php (modified) (2 diffs)
-
assets/js/RFWP_BlockInserting.js (modified) (2 diffs)
-
realbigForWP.php (modified) (14 diffs)
-
rssGenerator.php (modified) (1 diff)
-
synchronising.php (modified) (8 diffs)
-
testFunctions.php (modified) (1 diff)
-
textEditing.php (modified) (9 diffs)
-
uninstall.php (modified) (2 diffs)
-
update.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
realbig-media/trunk/README.MD
r3090592 r3103368 2 2 Contributors: 101 3 3 Tags: AD, content filling 4 Requires at least: 6.24 Requires at least: 4.5 5 5 Tested up to: 6.5.3 6 6 Stable tag: 0.1.26.56 … … 108 108 == Changelog == 109 109 110 = 1.1.1 = 111 112 Изменения версии: 113 114 * вернули поддержку старых версий Wordpress (4.5); 115 * другие мелкие улучшения и правки. 116 110 117 = 1.1.0 = 111 118 -
realbig-media/trunk/README.txt
r3090592 r3103368 2 2 Contributors: 101 3 3 Tags: AD, content filling 4 Requires at least: 6.24 Requires at least: 4.5 5 5 Tested up to: 6.5.3 6 6 Stable tag: 0.1.26.56 … … 108 108 == Changelog == 109 109 110 = 1.1.1 = 111 112 Изменения версии: 113 114 * вернули поддержку старых версий Wordpress (4.5); 115 * другие мелкие улучшения и правки. 116 110 117 = 1.1.0 = 111 118 -
realbig-media/trunk/RFWP_AdminPage.php
r3090592 r3103368 67 67 68 68 // @codingStandardsIgnoreStart 69 $res['getBlocks'] = $wpdb->get_results( $wpdb->prepare('SELECT * FROM %i', "{$wpPrefix}realbig_plugin_settings"), ARRAY_A);70 71 $cached = $wpdb->get_results($wpdb->prepare( 'SELECT post_title, post_content, post_type FROM %i '.72 'WHERE post_type IN (%s, %s, %s)', "{$wpPrefix}posts", "rb_block_desktop_new", "rb_block_tablet_new", "rb_block_mobile_new"));69 $res['getBlocks'] = $wpdb->get_results("SELECT * FROM `{$wpPrefix}realbig_plugin_settings`", ARRAY_A); 70 71 $cached = $wpdb->get_results($wpdb->prepare("SELECT post_title, post_content, post_type FROM `{$wpPrefix}posts` " . 72 "WHERE post_type IN (%s, %s, %s)", "rb_block_desktop_new", "rb_block_tablet_new", "rb_block_mobile_new")); 73 73 // @codingStandardsIgnoreEnd 74 74 $cacheKeys = ["rb_block_desktop_new" => "desktop", "rb_block_tablet_new" => "tablet", "rb_block_mobile_new" => "mobile"]; … … 85 85 try { 86 86 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 87 $res['rbSettings'] = $wpdb->get_results($wpdb->prepare('SELECT optionName, optionValue, timeUpdate FROM %i ' . 88 'WHERE optionName IN ("deactError","domain","excludedMainPage","excludedPages","pushStatus",' . 89 '"excludedPageTypes","excludedIdAndClasses","kill_rb","pushUniversalStatus","pushUniversalDomain",' . 90 '"statusFor404","blockDuplicate","jsToHead","obligatoryMargin","tagsListForTextLength","usedTaxonomies",' . 91 '"enableLogs")', "{$GLOBALS['wpPrefix']}realbig_settings"), ARRAY_A); 87 $res['rbSettings'] = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue, timeUpdate " . 88 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 89 "FROM `{$GLOBALS['wpPrefix']}realbig_settings` " . 90 'WHERE optionName IN (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', 91 "deactError", "domain", "excludedMainPage", "excludedPages", "pushStatus", "excludedPageTypes", 92 "excludedIdAndClasses", "kill_rb", "pushUniversalStatus", "pushUniversalDomain", "statusFor404", 93 "blockDuplicate", "jsToHead", "obligatoryMargin", "tagsListForTextLength", "usedTaxonomies", 94 "enableLogs"), ARRAY_A); 92 95 // $rbTransients = $wpdb->get_results('SELECT optionName, optionValue, timeUpdate FROM ' . $GLOBALS["wpPrefix"] . 'realbig_settings WHERE optionName IN ("deactError","domain","excludedMainPage","excludedPages","pushStatus","excludedPageTypes","kill_rb")', ARRAY_A); 93 96 -
realbig-media/trunk/RFWP_Amp.php
r3062761 r3103368 65 65 } 66 66 global $wpdb; 67 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 68 $ampAds = $wpdb->get_results( $wpdb->prepare('SELECT * FROM %i WRAA', "{$GLOBALS['wpPrefix']}realbig_amp_ads"));67 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 68 $ampAds = $wpdb->get_results("SELECT * FROM `{$GLOBALS['wpPrefix']}realbig_amp_ads` WRAA"); 69 69 if (empty($ampAds)) { 70 70 return $content; -
realbig-media/trunk/RFWP_Cache.php
r3062761 r3103368 111 111 global $wpPrefix; 112 112 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 113 $wpdb->query($wpdb->prepare( 'DELETE FROM %i WHERE post_type IN (%s, %s, %s)',114 " {$wpPrefix}posts", "rb_block_desktop_new", "rb_block_tablet_new", "rb_block_mobile_new"));113 $wpdb->query($wpdb->prepare("DELETE FROM `{$wpPrefix}posts` WHERE post_type IN (%s, %s, %s)", 114 "rb_block_desktop_new", "rb_block_tablet_new", "rb_block_mobile_new")); 115 115 } 116 116 -
realbig-media/trunk/RFWP_Utils.php
r3062761 r3103368 51 51 52 52 // @codingStandardsIgnoreStart 53 $getOption = $wpdb->query($wpdb->prepare("SELECT id FROM %i WHERE optionName = %s", "{$wpPrefix}realbig_settings", $optionName));53 $getOption = $wpdb->query($wpdb->prepare("SELECT id FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", $optionName)); 54 54 if (empty($getOption)) { 55 55 $res = $wpdb->insert($wpPrefix.'realbig_settings', ['optionName' => $optionName, 'optionValue' => $value]); … … 76 76 global $wpdb; 77 77 $wpPrefix = RFWP_getWpPrefix(); 78 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 79 $getOption = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM %i WHERE optionName = %s", "{$wpPrefix}realbig_settings", $optionName)); 78 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 79 $getOption = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", 80 $optionName)); 80 81 81 82 return $getOption; -
realbig-media/trunk/assets/js/RFWP_BlockInserting.js
r3090592 r3103368 1 class RFWP_BlockInserting{1 window.RFWP_BlockInserting = class { 2 2 _blockSettingArray; 3 3 … … 1040 1040 return {array: tlArray, length: textLength}; 1041 1041 } 1042 } 1042 }; -
realbig-media/trunk/realbigForWP.php
r3090592 r3103368 6 6 Plugin name: Realbig Media 7 7 Description: Плагин для монетизации от RealBig.media 8 Version: 1.1. 08 Version: 1.1.1 9 9 Author: Realbig Team 10 10 Author URI: https://realbig.media … … 89 89 $GLOBALS['rb_variables']['localRotatorUrl'] = null; 90 90 $GLOBALS['rb_variables']['adWithStatic'] = null; 91 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 92 $getOV = $wpdb->get_results( $wpdb->prepare("SELECT optionName, optionValue FROM %i" .93 " WHERE optionName IN ('domain','rotator','localRotatorUrl','adWithStatic')", "{$GLOBALS['wpPrefix']}realbig_settings"));91 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 92 $getOV = $wpdb->get_results("SELECT optionName, optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` " . 93 "WHERE optionName IN ('domain','rotator','localRotatorUrl','adWithStatic')"); 94 94 if (!empty($getOV)) { 95 95 foreach ($getOV AS $k => $item) { … … 242 242 $getRotator = 'f6ds8jhy56'; 243 243 244 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 245 $getOV = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue FROM %i WHERE optionName IN (%s, %s)",246 " {$GLOBALS['wpPrefix']}realbig_settings", "domain", "rotator"));244 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 245 $getOV = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` " . 246 "WHERE optionName IN (%s, %s)", "domain", "rotator")); 247 247 foreach ($getOV AS $k => $item) { 248 248 if (!empty($item->optionValue)) { … … 285 285 $getCode = ''; 286 286 287 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 288 $array = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM %iWHERE optionName=%s",289 " {$GLOBALS['wpPrefix']}realbig_settings", "rotatorCode"), ARRAY_A);287 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 288 $array = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` WHERE optionName=%s", 289 "rotatorCode"), ARRAY_A); 290 290 291 291 if (!empty($array[0]['optionValue'])) { … … 325 325 $pushDomain = $GLOBALS['rb_push']['universalDomain']; 326 326 } else { 327 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 328 $pushDomain = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM %i WHERE optionName = %s",329 " {$GLOBALS['wpPrefix']}realbig_settings", "pushUniversalDomain"));327 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 328 $pushDomain = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` " . 329 "WHERE optionName = %s", "pushUniversalDomain")); 330 330 } 331 331 if (empty($pushDomain)) { … … 437 437 $statusFor404 = 'show'; 438 438 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 439 $realbig_settings_info = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue FROM %i WGPS " . 440 "WHERE optionName IN (%s, %s, %s)", 441 "{$GLOBALS['wpPrefix']}realbig_settings", 'excludedIdAndClasses', 'blockDuplicate', 'statusFor404')); 439 $realbig_settings_info = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue " . 440 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 441 "FROM `{$GLOBALS['wpPrefix']}realbig_settings` WGPS WHERE optionName IN (%s, %s, %s)", 442 'excludedIdAndClasses', 'blockDuplicate', 'statusFor404')); 442 443 if (!empty($realbig_settings_info)) { 443 444 foreach ($realbig_settings_info AS $k => $item) { … … 476 477 477 478 if ((!is_404())||$statusFor404!='disable') { 479 // @codingStandardsIgnoreStart 478 480 if (!empty($content)) { 479 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 480 $fromDb = $wpdb->get_results($wpdb->prepare("SELECT * FROM %i WGPS", 481 "{$GLOBALS['wpPrefix']}realbig_plugin_settings")); 481 $fromDb = $wpdb->get_results("SELECT * FROM `{$GLOBALS['wpPrefix']}realbig_plugin_settings` WGPS"); 482 482 } else { 483 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 484 $fromDb = $wpdb->get_results($wpdb->prepare("SELECT * FROM %i WGPS WHERE setting_type = 3", 485 "{$GLOBALS['wpPrefix']}realbig_plugin_settings")); 483 $fromDb = $wpdb->get_results("SELECT * FROM `{$GLOBALS['wpPrefix']}realbig_plugin_settings` WGPS WHERE setting_type = 3"); 486 484 } 485 // @codingStandardsIgnoreEnd 487 486 } 488 487 … … 580 579 echo PHP_EOL . "</script>" . PHP_EOL; 581 580 582 $GLOBALS['rfwp_addedAlready']['asyncBlockInserting'] = true;581 $GLOBALS['rfwp_addedAlready']['asyncBlockInserting'] = true; 583 582 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) { 584 583 RFWP_WorkProgressLog(false,'asyncBlockInserting file add'); … … 674 673 if (empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON))) { 675 674 if ((!empty($curUserCan)&&!empty($_POST['statusRefresher']))||empty($tableForToken)||empty($tableForCurrentPluginChecker)) { 676 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 677 $wpdb->query($wpdb->prepare("DELETE FROM %iWHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0",678 " {$wpPrefix}posts", "rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_tablet_new", "rb_block_desktop_new"));675 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 676 $wpdb->query($wpdb->prepare("DELETE FROM `{$wpPrefix}posts` WHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0", 677 "rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_tablet_new", "rb_block_desktop_new")); 679 678 RFWP_Cache::deleteCaches(); 680 679 delete_option('realbig_status_gatherer_version'); … … 707 706 /********** checking and creating tables ******************************************************************************/ 708 707 if ((!empty($lastSuccessVersionGatherer)&&$lastSuccessVersionGatherer != $GLOBALS['realbigForWP_version'])||empty($lastSuccessVersionGatherer)) { 709 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 710 $wpdb->query($wpdb->prepare("DELETE FROM %iWHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0",711 "{$wpPrefix}posts","rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_tablet_new", "rb_block_desktop_new"));708 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 709 $wpdb->query($wpdb->prepare("DELETE FROM `{$wpPrefix}posts` WHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0", 710 "rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_tablet_new", "rb_block_desktop_new")); 712 711 RFWP_Cache::deleteCaches(); 713 712 … … 731 730 } 732 731 if ($statusGatherer['realbig_plugin_settings_table'] == true && ($statusGatherer['realbig_plugin_settings_columns'] == false || $lastSuccessVersionGatherer != $GLOBALS['realbigForWP_version'])) { 733 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 734 $colCheck = $wpdb->get_col( $wpdb->prepare("SHOW COLUMNS FROM %i", "{$wpPrefix}realbig_plugin_settings"));732 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 733 $colCheck = $wpdb->get_col("SHOW COLUMNS FROM `{$wpPrefix}realbig_plugin_settings`"); 735 734 if (!empty($colCheck)) { 736 735 $statusGatherer = RFWP_wpRealbigPluginSettingsColomnUpdateFunction($wpPrefix, $colCheck, $statusGatherer); … … 752 751 753 752 // @codingStandardsIgnoreStart 754 $unmarkSuccessfulUpdate = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM %i WHERE optionName = %s",755 " {$wpPrefix}realbig_settings", "successUpdateMark"));756 $jsAutoSynchronizationStatus = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM %i WHERE optionName = %s",757 " {$wpPrefix}realbig_settings", "jsAutoSyncFails"));753 $unmarkSuccessfulUpdate = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` " . 754 "WHERE optionName = %s", "successUpdateMark")); 755 $jsAutoSynchronizationStatus = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` " . 756 "WHERE optionName = %s", "jsAutoSyncFails")); 758 757 // @codingStandardsIgnoreEnd 759 758 … … 813 812 $excludedPage = true; 814 813 } elseif (!empty($usedUrl)||!empty($usedUrl2)) { 815 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 816 $pageChecksDb = $wpdb->get_results($wpdb->prepare("SELECT optionValue, optionName FROM %i WHERE optionName IN (%s,%s,%s)",817 " {$wpPrefix}realbig_settings", "excludedMainPage", "excludedPages", "excludedPageTypes"), ARRAY_A);814 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 815 $pageChecksDb = $wpdb->get_results($wpdb->prepare("SELECT optionValue, optionName FROM `{$wpPrefix}realbig_settings` " . 816 "WHERE optionName IN (%s,%s,%s)", "excludedMainPage", "excludedPages", "excludedPageTypes"), ARRAY_A); 818 817 $pageChecks = []; 819 818 foreach ($pageChecksDb AS $k => $item) { … … 969 968 add_action('wp_head', 'RFWP_AD_header_add', 0); 970 969 $separatedStatuses = []; 971 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 972 $statuses = $wpdb->get_results($wpdb->prepare( 'SELECT optionName, optionValue FROM %i WHERE optionName IN (%s,%s,%s)',973 " {$wpPrefix}realbig_settings", "pushUniversalCode", "pushUniversalStatus", "pushUniversalDomain"), ARRAY_A);970 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 971 $statuses = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue FROM `{$wpPrefix}realbig_settings` " . 972 "WHERE optionName IN (%s,%s,%s)", "pushUniversalCode", "pushUniversalStatus", "pushUniversalDomain"), ARRAY_A); 974 973 if (!empty($statuses)) { 975 974 foreach ($statuses AS $k => $item) { -
realbig-media/trunk/rssGenerator.php
r3062761 r3103368 75 75 global $wpPrefix; 76 76 77 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 78 $rb_turboAds = $wpdb->get_results( $wpdb->prepare("SELECT * FROM %i", "{$wpPrefix}realbig_turbo_ads"), ARRAY_A);77 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 78 $rb_turboAds = $wpdb->get_results("SELECT * FROM `{$wpPrefix}realbig_turbo_ads`", ARRAY_A); 79 79 $GLOBALS['rb_turboAds'] = $rb_turboAds; 80 80 } else { -
realbig-media/trunk/synchronising.php
r3090592 r3103368 130 130 $counter = 0; 131 131 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 132 $wpdb->query( $wpdb->prepare('DELETE FROM %i', "{$wpPrefix}realbig_plugin_settings"));133 $params = [ "{$wpPrefix}realbig_plugin_settings"];134 $sqlTokenSave = "INSERT INTO %i(text, block_number, setting_type, element, directElement, elementPosition, " .132 $wpdb->query("DELETE FROM `{$wpPrefix}realbig_plugin_settings`"); 133 $params = []; 134 $sqlTokenSave = "INSERT INTO `{$wpPrefix}realbig_plugin_settings` (text, block_number, setting_type, element, directElement, elementPosition, " . 135 135 "elementPlace, firstPlace, elementCount, elementStep, minSymbols, maxSymbols, minHeaders, maxHeaders, " . 136 136 "onCategories, offCategories, onTags, offTags, elementCss, showNoElement) VALUES "; … … 170 170 } elseif (empty($decodedToken['data'])&&sanitize_text_field($decodedToken['status']) == "empty_success") { 171 171 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 172 $wpdb->query( $wpdb->prepare('DELETE FROM %i', "{$wpPrefix}realbig_plugin_settings"));172 $wpdb->query("DELETE FROM `{$wpPrefix}realbig_plugin_settings`"); 173 173 } 174 174 … … 349 349 /** Turbo rss ads */ 350 350 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 351 $wpdb->query( $wpdb->prepare('DELETE FROM %i', "{$wpPrefix}realbig_turbo_ads"));351 $wpdb->query("DELETE FROM `{$wpPrefix}realbig_turbo_ads`"); 352 352 if (!empty($decodedToken['turboAdSettings'])) { 353 353 $counter = 0; 354 $params = [ "{$wpPrefix}realbig_turbo_ads"];355 $sqlTokenSave = "INSERT INTO %i(blockId, adNetwork, adNetworkYandex, adNetworkAdfox, settingType, element, " .354 $params = []; 355 $sqlTokenSave = "INSERT INTO `{$wpPrefix}realbig_turbo_ads` (blockId, adNetwork, adNetworkYandex, adNetworkAdfox, settingType, element, " . 356 356 "elementPosition, elementPlace) VALUES "; 357 357 unset($k, $item); … … 383 383 $counter = 0; 384 384 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 385 $wpdb->query( $wpdb->prepare('DELETE FROM %i', "{$wpPrefix}realbig_amp_ads"));386 $params = [ "{$wpPrefix}realbig_amp_ads"];387 $sqlTokenSave = "INSERT INTO %i(blockId, adField, settingType, element, elementPosition, elementPlace) VALUES ";385 $wpdb->query("DELETE FROM `{$wpPrefix}realbig_amp_ads`"); 386 $params = []; 387 $sqlTokenSave = "INSERT INTO `{$wpPrefix}realbig_amp_ads` (blockId, adField, settingType, element, elementPosition, elementPlace) VALUES "; 388 388 foreach ($decodedToken['ampAdSettings'] AS $k => $item) { 389 389 $counter ++; … … 572 572 case 'mobile': 573 573 $postCheckMobile = $wpdb->get_var( 574 $wpdb->prepare( 'SELECT id FROM %i WHERE post_type = %s AND post_title = %s',575 " {$wpPrefix}posts", "rb_block_mobile_new", $ritem["blockId"]));574 $wpdb->prepare("SELECT id FROM `{$wpPrefix}posts` WHERE post_type = %s AND post_title = %s", 575 "rb_block_mobile_new", $ritem["blockId"])); 576 576 $resultTypes['mobile'] = true; 577 577 break; 578 578 case 'tablet': 579 579 $postCheckTablet = $wpdb->get_var( 580 $wpdb->prepare( 'SELECT id FROM %i WHERE post_type = %s AND post_title = %s',581 " {$wpPrefix}posts", "rb_block_tablet_new", $ritem["blockId"]));580 $wpdb->prepare("SELECT id FROM `{$wpPrefix}posts` WHERE post_type = %s AND post_title = %s", 581 "rb_block_tablet_new", $ritem["blockId"])); 582 582 $resultTypes['tablet'] = true; 583 583 break; 584 584 case 'desktop': 585 585 $postCheckDesktop = $wpdb->get_var( 586 $wpdb->prepare( 'SELECT id FROM %i WHERE post_type = %s AND post_title = %s',587 " {$wpPrefix}posts", "rb_block_desktop_new", $ritem["blockId"]));586 $wpdb->prepare("SELECT id FROM `{$wpPrefix}posts` WHERE post_type = %s AND post_title = %s", 587 "rb_block_desktop_new", $ritem["blockId"])); 588 588 $resultTypes['desktop'] = true; 589 589 break; … … 695 695 if (empty($GLOBALS['tokenTimeUpdate'])) { 696 696 // @codingStandardsIgnoreStart 697 $timeUpdate = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM %iWHERE optionName = %s",698 " {$wpPrefix}realbig_settings", "token_sync_time"));697 $timeUpdate = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", 698 "token_sync_time")); 699 699 if (empty($timeUpdate)) { 700 700 $updateResult = RFWP_wpRealbigSettingsTableUpdateFunction($wpPrefix); 701 701 if ($updateResult == true) { 702 $timeUpdate = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM %iWHERE optionName = %s",703 " {$wpPrefix}realbig_settings", "token_sync_time"));702 $timeUpdate = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", 703 "token_sync_time")); 704 704 } 705 705 } … … 739 739 global $wpdb; 740 740 $GLOBALS['tokenStatusMessage'] = null; 741 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 742 $token = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM %iWHERE optionName = %s",743 " {$wpPrefix}realbig_settings", "_wpRealbigPluginToken"));741 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 742 $token = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", 743 "_wpRealbigPluginToken")); 744 744 745 745 if (!empty($token)) { … … 1294 1294 1295 1295 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1296 $syncDomain = $wpdb->get_var($wpdb->prepare( 'SELECT optionValue FROM %i WGPS WHERE optionName = %s',1297 " {$wpPrefix}realbig_settings", "sync_domain"));1296 $syncDomain = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WGPS WHERE optionName = %s", 1297 "sync_domain")); 1298 1298 } 1299 1299 -
realbig-media/trunk/testFunctions.php
r3062761 r3103368 3 3 /** Kill rb connection emulation */ 4 4 // 1 - ok connection; 2 - error connection; 5 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 6 $kill_rb_db = $wpdb->get_results($wpdb->prepare( 'SELECT id,optionValue FROM %i WHERE optionName = %s',7 " {$wpPrefix}realbig_settings", "kill_rb"), ARRAY_A);5 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 6 $kill_rb_db = $wpdb->get_results($wpdb->prepare("SELECT id,optionValue FROM `{$wpPrefix}realbig_settings` WHERE optionName = %s", 7 "kill_rb"), ARRAY_A); 8 8 if (empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON)) && !empty(is_admin()) 9 9 && wp_get_raw_referer() && !wp_get_referer()) { -
realbig-media/trunk/textEditing.php
r3090592 r3103368 228 228 $checkExcluded = RFWP_checkPageType(); 229 229 if (!empty($checkExcluded)&&!empty($fromDb)&&!empty($fromDb['adBlocks'])&&count($fromDb['adBlocks']) > 0) { 230 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 231 $contentSelector = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM %i WHERE optionName = %s",232 " {$wpPrefix}realbig_settings", "contentSelector"));230 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 231 $contentSelector = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` " . 232 "WHERE optionName = %s", "contentSelector")); 233 233 if (empty($contentSelector)) { 234 234 $contentSelector = null; … … 290 290 let deniedClasses = [\'.percentPointerClass\',\'.addedInserting\',\'#toc_container\']; 291 291 let deniedString = ""; 292 let contentSelector = \''.esc_attr(stripslashes( $contentSelector)).'\';292 let contentSelector = \''.esc_attr(stripslashes((string)$contentSelector)).'\'; 293 293 let contentsCheck = null; 294 294 if (contentSelector) { … … 692 692 $result['excIdClass'] = null; 693 693 $result['blockDuplicate'] = 'yes'; 694 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 695 $realbig_settings_info = $wpdb->get_results($wpdb->prepare( 'SELECT optionName, optionValue FROM %i WGPS WHERE optionName IN (%s, %s)',696 " {$GLOBALS['wpPrefix']}realbig_settings", "excludedIdAndClasses", "blockDuplicate"));694 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 695 $realbig_settings_info = $wpdb->get_results($wpdb->prepare("SELECT optionName, optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` WGPS " . 696 "WHERE optionName IN (%s, %s)", "excludedIdAndClasses", "blockDuplicate")); 697 697 if (!empty($realbig_settings_info)) { 698 698 foreach ($realbig_settings_info AS $k => $item) { … … 1059 1059 // @codingStandardsIgnoreStart 1060 1060 if (isset($filter)&&in_array($filter, [0,1])) { 1061 $posts = $wpdb->get_results($wpdb->prepare( 'SELECT * FROM %i WHERE post_type = %s AND pinged = %s',1062 " {$wpPrefix}posts", "rb_inserting", $filter));1061 $posts = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpPrefix}posts` WHERE post_type = %s AND pinged = %s", 1062 "rb_inserting", $filter)); 1063 1063 } else { 1064 $posts = $wpdb->get_results($wpdb->prepare( 'SELECT * FROM %i WHERE post_type = %s',1065 " {$wpPrefix}posts", "rb_inserting"));1064 $posts = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpPrefix}posts` WHERE post_type = %s", 1065 "rb_inserting")); 1066 1066 } 1067 1067 // @codingStandardsIgnoreEnd … … 1386 1386 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1387 1387 $realbig_settings_info = $wpdb->get_results($wpdb->prepare( 1388 'SELECT optionName, optionValue FROM %i WGPS WHERE optionName IN (%s, %s, %s, %s,%s,%s)', 1389 "{$wpPrefix}realbig_settings", "excludedIdAndClasses", "blockDuplicate", "obligatoryMargin", 1388 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 1389 "SELECT optionName, optionValue FROM `{$wpPrefix}realbig_settings` WGPS WHERE optionName IN (%s, %s, %s, %s,%s,%s)", 1390 "excludedIdAndClasses", "blockDuplicate", "obligatoryMargin", 1390 1391 "statusFor404", "showAdsNoElement", "tagsListForTextLength")); 1391 1392 if (!empty($realbig_settings_info)) { … … 1419 1420 } 1420 1421 if ((!is_404())||$statusFor404!='disable') { 1421 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1422 $adBlocks = $wpdb->get_results( $wpdb->prepare('SELECT * FROM %i WGPS', "{$wpPrefix}realbig_plugin_settings"));1422 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 1423 $adBlocks = $wpdb->get_results("SELECT * FROM `{$wpPrefix}realbig_plugin_settings` WGPS"); 1423 1424 } 1424 1425 … … 1648 1649 $usedTaxonomies = []; 1649 1650 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1650 $array = $wpdb->get_results($wpdb->prepare( 'SELECT optionValue FROM %i WGPS WHERE optionName = %s',1651 " {$wpPrefix}realbig_settings", "usedTaxonomies"));1651 $array = $wpdb->get_results($wpdb->prepare("SELECT optionValue FROM `{$wpPrefix}realbig_settings` WGPS WHERE optionName = %s", 1652 "usedTaxonomies")); 1652 1653 1653 1654 if (!empty($array[0]->optionValue)) { … … 1716 1717 global $wpdb; 1717 1718 1718 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1719 $jsToHead = $wpdb->get_var($wpdb->prepare( 'SELECT optionValue FROM %i WHERE optionName = %s',1720 " {$GLOBALS['wpPrefix']}realbig_settings", "jsToHead"));1719 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 1720 $jsToHead = $wpdb->get_var($wpdb->prepare("SELECT optionValue FROM `{$GLOBALS['wpPrefix']}realbig_settings` " . 1721 "WHERE optionName = %s", "jsToHead")); 1721 1722 if ($jsToHead!==null) { 1722 1723 $jsToHead = intval($jsToHead); … … 1745 1746 $wpPrefix = RFWP_getTablePrefix(); 1746 1747 1747 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1748 $result = $wpdb->prepare($wpdb->get_var( 'SELECT optionValue FROM %i WHERE optionName = %s'),1749 " {$wpPrefix}realbig_settings", $settingName);1748 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 1749 $result = $wpdb->prepare($wpdb->get_var("SELECT optionValue FROM `{$wpPrefix}realbig_settings` " . 1750 "WHERE optionName = %s"), $settingName); 1750 1751 if (!empty($addToGlobal)) { 1751 1752 $GLOBALS['rb_variables'][$settingName] = $result; -
realbig-media/trunk/uninstall.php
r3062761 r3103368 24 24 $GLOBALS['wpPrefix'] = $wpPrefix; 25 25 26 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 27 $wpdb->query($wpdb->prepare( 'DELETE FROM %i WHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0',28 " {$wpPrefix}posts", "rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_desktop_new", "rb_inserting"));26 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 27 $wpdb->query($wpdb->prepare("DELETE FROM `{$wpPrefix}posts` WHERE post_type IN (%s, %s, %s, %s, %s) AND post_author = 0", 28 "rb_block_mobile", "rb_block_desktop", "rb_block_mobile_new", "rb_block_desktop_new", "rb_inserting")); 29 29 30 30 delete_option( 'realbig_status_gatherer' ); … … 32 32 33 33 // @codingStandardsIgnoreStart 34 $wpdb->query( $wpdb->prepare("DROP TABLE IF EXISTS %i", "{$wpPrefix}realbig_plugin_settings"));35 $wpdb->query( $wpdb->prepare("DROP TABLE IF EXISTS %i", "{$wpPrefix}realbig_settings"));34 $wpdb->query("DROP TABLE IF EXISTS `{$wpPrefix}realbig_plugin_settings`"); 35 $wpdb->query("DROP TABLE IF EXISTS `{$wpPrefix}realbig_settings`"); 36 36 // @codingStandardsIgnoreEnd 37 37 } -
realbig-media/trunk/update.php
r3090592 r3103368 157 157 $localReturnValue = false; 158 158 159 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 160 $enumTypeQuery = $wpdb->get_results($wpdb->prepare( 'SHOW FIELDS FROM %i WHERE Field = %s',161 " {$wpPrefix}realbig_plugin_settings", "element"));159 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 160 $enumTypeQuery = $wpdb->get_results($wpdb->prepare("SHOW FIELDS FROM `{$wpPrefix}realbig_plugin_settings` WHERE Field = %s", 161 "element")); 162 162 if (!empty($enumTypeQuery)) { 163 163 $enumTypeQuery = get_object_vars($enumTypeQuery[0]); 164 164 if ($enumTypeQuery['Type'] != $requiredElementColumnValues) { 165 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 166 $alterResult = $wpdb->query($wpdb->prepare("ALTER TABLE %iMODIFY `element` " .165 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 166 $alterResult = $wpdb->query($wpdb->prepare("ALTER TABLE `{$wpPrefix}realbig_plugin_settings` MODIFY `element` " . 167 167 "ENUM(%s, %s , %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) NULL DEFAULT NULL", 168 " {$wpPrefix}realbig_plugin_settings", "p", "li", "ul", "ol", "blockquote", "img", "video",168 "p", "li", "ul", "ol", "blockquote", "img", "video", 169 169 "iframe", "h1", "h2", "h3", "h4", "h5", "h6", 'h2-4', "article")); 170 170 if (!empty($alterResult)&&is_int($alterResult)&&$alterResult == 1) { … … 199 199 try { 200 200 // @codingStandardsIgnoreStart 201 $rez = $wpdb->query( $wpdb->prepare('SHOW FIELDS FROM %i', "{$wpPrefix}realbig_settings"));201 $rez = $wpdb->query("SHOW FIELDS FROM `{$wpPrefix}realbig_settings`"); 202 202 203 203 if ($rez != 4) { 204 $wpdb->query( $wpdb->prepare('ALTER TABLE %i ADD `timeUpdate` TIMESTAMP NULL DEFAULT NULL ON '.205 'UPDATE CURRENT_TIMESTAMP AFTER optionValue', "{$wpPrefix}realbig_settings"));204 $wpdb->query("ALTER TABLE `{$wpPrefix}realbig_settings` ADD `timeUpdate` TIMESTAMP NULL DEFAULT NULL ON " . 205 "UPDATE CURRENT_TIMESTAMP AFTER optionValue"); 206 206 } 207 207 // @codingStandardsIgnoreEnd … … 255 255 // @codingStandardsIgnoreStart 256 256 if (in_array($item, ['text','directElement','onCategories','offCategories','onTags','offTags','elementCss'])) { 257 $wpdb->query($wpdb->prepare('ALTER TABLE %i ADD COLUMN %i TEXT NULL DEFAULT NULL', 258 "{$wpPrefix}realbig_plugin_settings", $item)); 257 $wpdb->query("ALTER TABLE `{$wpPrefix}realbig_plugin_settings` ADD COLUMN `{$item}` TEXT NULL DEFAULT NULL"); 259 258 } else { 260 $wpdb->query($wpdb->prepare('ALTER TABLE %i ADD COLUMN %i INT(11) NULL DEFAULT NULL', 261 "{$wpPrefix}realbig_plugin_settings", $item)); 259 $wpdb->query("ALTER TABLE `{$wpPrefix}realbig_plugin_settings` ADD COLUMN `{$item}` INT(11) NULL DEFAULT NULL"); 262 260 } 263 261 // @codingStandardsIgnoreEnd
Note: See TracChangeset
for help on using the changeset viewer.