Changeset 3464745
- Timestamp:
- 02/19/2026 05:25:32 AM (5 weeks ago)
- Location:
- bit-assist
- Files:
-
- 82 edited
- 1 copied
-
tags/1.6.1 (copied) (copied from bit-assist/trunk)
-
tags/1.6.1/backend/app/Config.php (modified) (5 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/AnalyticsController.php (modified) (16 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/ApiWidgetController.php (modified) (3 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/BitAssistAnalyticsController.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Controllers/DownloadController.php (modified) (4 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/IframeController.php (modified) (3 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/ResponseController.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Controllers/WPPostController.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Controllers/WidgetChannelController.php (modified) (2 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/WidgetController.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Controllers/WooChannelController.php (modified) (2 diffs)
-
tags/1.6.1/backend/app/HTTP/Controllers/WpSearchController.php (modified) (3 diffs)
-
tags/1.6.1/backend/app/HTTP/Middleware/AdminCheckerMiddleware.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Middleware/LoggedInCheckerMiddleware.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Middleware/NonceCheckerMiddleware.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Requests/WidgetChannelStoreRequest.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Requests/WidgetChannelUpdateRequest.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Requests/WidgetStoreRequest.php (modified) (1 diff)
-
tags/1.6.1/backend/app/HTTP/Requests/WidgetUpdateRequest.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Helpers/FileHandler.php (modified) (4 diffs)
-
tags/1.6.1/backend/app/Model/Analytics.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Model/Response.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Model/Widget.php (modified) (2 diffs)
-
tags/1.6.1/backend/app/Model/WidgetChannel.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Plugin.php (modified) (3 diffs)
-
tags/1.6.1/backend/app/Providers/HookProvider.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Providers/InstallerProvider.php (modified) (1 diff)
-
tags/1.6.1/backend/app/Views/Layout.php (modified) (6 diffs)
-
tags/1.6.1/backend/bootstrap.php (modified) (1 diff)
-
tags/1.6.1/backend/db/Migrations/BASTAnalyticsTableMigration.php (modified) (1 diff)
-
tags/1.6.1/backend/db/Migrations/BASTPluginOptions.php (modified) (2 diffs)
-
tags/1.6.1/backend/db/Migrations/BASTResponsesTableMigration.php (modified) (1 diff)
-
tags/1.6.1/backend/db/Migrations/BASTUpdateCustomCssColumnInWidgetTableMigration.php (modified) (3 diffs)
-
tags/1.6.1/backend/db/Migrations/BASTUpdateOptions.php (modified) (2 diffs)
-
tags/1.6.1/backend/db/Migrations/BASTWidgetChannelsTableMigration.php (modified) (1 diff)
-
tags/1.6.1/backend/db/Migrations/BASTWidgetsTableMigration.php (modified) (1 diff)
-
tags/1.6.1/backend/hooks/ajax.php (modified) (2 diffs)
-
tags/1.6.1/backend/hooks/api.php (modified) (2 diffs)
-
tags/1.6.1/index.php (modified) (2 diffs)
-
tags/1.6.1/readme.txt (modified) (2 diffs)
-
tags/1.6.1/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/backend/app/Config.php (modified) (5 diffs)
-
trunk/backend/app/HTTP/Controllers/AnalyticsController.php (modified) (16 diffs)
-
trunk/backend/app/HTTP/Controllers/ApiWidgetController.php (modified) (3 diffs)
-
trunk/backend/app/HTTP/Controllers/BitAssistAnalyticsController.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Controllers/DownloadController.php (modified) (4 diffs)
-
trunk/backend/app/HTTP/Controllers/IframeController.php (modified) (3 diffs)
-
trunk/backend/app/HTTP/Controllers/ResponseController.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Controllers/WPPostController.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Controllers/WidgetChannelController.php (modified) (2 diffs)
-
trunk/backend/app/HTTP/Controllers/WidgetController.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Controllers/WooChannelController.php (modified) (2 diffs)
-
trunk/backend/app/HTTP/Controllers/WpSearchController.php (modified) (3 diffs)
-
trunk/backend/app/HTTP/Middleware/AdminCheckerMiddleware.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Middleware/LoggedInCheckerMiddleware.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Middleware/NonceCheckerMiddleware.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Requests/WidgetChannelStoreRequest.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Requests/WidgetChannelUpdateRequest.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Requests/WidgetStoreRequest.php (modified) (1 diff)
-
trunk/backend/app/HTTP/Requests/WidgetUpdateRequest.php (modified) (1 diff)
-
trunk/backend/app/Helpers/FileHandler.php (modified) (4 diffs)
-
trunk/backend/app/Model/Analytics.php (modified) (1 diff)
-
trunk/backend/app/Model/Response.php (modified) (1 diff)
-
trunk/backend/app/Model/Widget.php (modified) (2 diffs)
-
trunk/backend/app/Model/WidgetChannel.php (modified) (1 diff)
-
trunk/backend/app/Plugin.php (modified) (3 diffs)
-
trunk/backend/app/Providers/HookProvider.php (modified) (1 diff)
-
trunk/backend/app/Providers/InstallerProvider.php (modified) (1 diff)
-
trunk/backend/app/Views/Layout.php (modified) (6 diffs)
-
trunk/backend/bootstrap.php (modified) (1 diff)
-
trunk/backend/db/Migrations/BASTAnalyticsTableMigration.php (modified) (1 diff)
-
trunk/backend/db/Migrations/BASTPluginOptions.php (modified) (2 diffs)
-
trunk/backend/db/Migrations/BASTResponsesTableMigration.php (modified) (1 diff)
-
trunk/backend/db/Migrations/BASTUpdateCustomCssColumnInWidgetTableMigration.php (modified) (3 diffs)
-
trunk/backend/db/Migrations/BASTUpdateOptions.php (modified) (2 diffs)
-
trunk/backend/db/Migrations/BASTWidgetChannelsTableMigration.php (modified) (1 diff)
-
trunk/backend/db/Migrations/BASTWidgetsTableMigration.php (modified) (1 diff)
-
trunk/backend/hooks/ajax.php (modified) (2 diffs)
-
trunk/backend/hooks/api.php (modified) (2 diffs)
-
trunk/index.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bit-assist/tags/1.6.1/backend/app/Config.php
r3429564 r3464745 5 5 namespace BitApps\Assist; 6 6 7 use BitApps\AssistPro\Config as ProConfig; 8 9 if (!\defined('ABSPATH')) { 7 if (!defined('ABSPATH')) { 10 8 exit; 11 9 } 10 11 use BitApps\AssistPro\Config as ProConfig; 12 12 13 13 /** … … 22 22 public const VAR_PREFIX = 'bit_assist_'; 23 23 24 public const VERSION = '1.6. 0';24 public const VERSION = '1.6.1'; 25 25 26 26 public const DB_VERSION = '1.0.3'; … … 60 60 61 61 case 'SITE_URL': 62 $parsedUrl = parse_url(get_admin_url());62 $parsedUrl = wp_parse_url(get_admin_url()); 63 63 $siteUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host']; 64 64 $siteUrl .= empty($parsedUrl['port']) ? null : ':' . $parsedUrl['port']; … … 67 67 68 68 case 'SITE_DOMAIN': 69 $parsedUrl = parse_url(get_admin_url());69 $parsedUrl = wp_parse_url(get_admin_url()); 70 70 71 71 return $parsedUrl['host']; … … 187 187 public static function isDev() 188 188 { 189 return \defined('BITAPPS_DEV') && BITAPPS_DEV;189 return defined('BITAPPS_DEV') && BITAPPS_DEV; 190 190 } 191 191 -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/AnalyticsController.php
r3241612 r3464745 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 9 use AllowDynamicProperties; 5 10 use BitApps\Assist\Config; 6 use AllowDynamicProperties; 11 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 12 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; 7 13 use BitApps\Assist\Model\Analytics; 8 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response;9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request;10 14 11 15 #[AllowDynamicProperties] … … 16 20 $analyticsOption = Config::getOption('analytics_activate'); 17 21 18 return $analyticsOption ? (int) $analyticsOption : 0;22 return $analyticsOption ? (int) $analyticsOption : 0; 19 23 } 20 24 … … 86 90 $iterations = 0; 87 91 88 $cutoff = date('Y-m-d H:i:s', strtotime("-{$retentionDays} days"));92 $cutoff = gmdate('Y-m-d H:i:s', strtotime("-{$retentionDays} days")); 89 93 90 94 $table = $wpdb->prefix . Config::VAR_PREFIX . 'analytics'; 91 95 96 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.PreparedSQL.NotPrepared -- Table name from WordPress constants, cutoff is a valid date string, batch size is a valid integer 92 97 $preparedQuery = $wpdb->prepare( 93 98 "DELETE FROM {$table} WHERE created_at < %s LIMIT %d", … … 97 102 98 103 /** 99 * If the number of records deleted in a batch is equal to the batch size,100 * and the number of iterations is less than the maximum number of iterations,101 * continue deleting records in batches.102 */104 * If the number of records deleted in a batch is equal to the batch size, 105 * and the number of iterations is less than the maximum number of iterations, 106 * continue deleting records in batches. 107 */ 103 108 do { 109 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 104 110 $deletedCount = $wpdb->query($preparedQuery); 105 111 … … 115 121 $isDate = preg_match($datePattern, $filterValue) === 1; 116 122 117 $startDate = date('Y-m-d');118 $endDate = date('Y-m-d');123 $startDate = gmdate('Y-m-d'); 124 $endDate = gmdate('Y-m-d'); 119 125 $dateRange = []; 120 126 … … 125 131 $placeHolder = [0, 1, 0, 1, 1, 0, 0, 1]; 126 132 133 // Build the date condition SQL 127 134 $dateCondition = ''; 128 135 if ($filterValue === '7days') { … … 132 139 } elseif ($filterValue === 'today') { 133 140 $dateCondition = 'DATE(analytics.created_at) = CURDATE()'; 134 } elseif ($isDate && isset($dateRange[0] ) && isset($dateRange[1])) {141 } elseif ($isDate && isset($dateRange[0], $dateRange[1])) { 135 142 $startDate = $dateRange[0]; 136 143 $endDate = $dateRange[1]; … … 138 145 $placeHolder[] = $endDate; 139 146 $dateCondition = 'DATE(analytics.created_at) BETWEEN %s AND %s'; 140 } elseif ($isDate && count($dateRange) !== 2) {147 } elseif ($isDate && \count($dateRange) !== 2) { 141 148 $startDate = $dateRange[0]; 142 149 $placeHolder[] = $startDate; … … 146 153 } 147 154 155 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- Table names from WordPress constants, date condition is built securely above, placeholder count varies by filter 148 156 $sql = $wpdb->prepare( 149 157 "SELECT … … 158 166 (analytics.channel_id IS NULL AND (analytics.is_clicked = %d OR analytics.is_clicked = %d)) 159 167 AND 160 $dateCondition168 {$dateCondition} 161 169 GROUP BY 162 170 analytics.widget_id, widgets.name", 163 171 $placeHolder 164 172 ); 165 173 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber 174 175 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Query is prepared above, direct query for analytics reporting 166 176 $widgetAnalyticsData = $wpdb->get_results($sql); 167 177 … … 176 186 $filterValue = $request->filter; 177 187 $datePattern = '/\d{4}-\d{2}-\d{2}/'; 178 $isDate = is_array($filterValue) ? preg_match($datePattern, $filterValue[0]) === 1 : false;179 180 $startDate = date('Y-m-d');181 $endDate = date('Y-m-d');188 $isDate = \is_array($filterValue) ? preg_match($datePattern, $filterValue[0]) === 1 : false; 189 190 $startDate = gmdate('Y-m-d'); 191 $endDate = gmdate('Y-m-d'); 182 192 183 193 $placeHolder = [1, 0, 1, 0, $widget_id, 1]; 184 194 195 // Build the date condition SQL 185 196 $dateCondition = ''; 186 197 if ($filterValue === '7days') { … … 190 201 } elseif ($filterValue === 'today') { 191 202 $dateCondition = 'DATE(analytics.created_at) = CURDATE()'; 192 } elseif ($isDate && isset($filterValue[0] ) && isset($filterValue[1])) {203 } elseif ($isDate && isset($filterValue[0], $filterValue[1])) { 193 204 $startDate = $filterValue[0]; 194 205 $endDate = $filterValue[1]; … … 196 207 $placeHolder[] = $endDate; 197 208 $dateCondition = 'DATE(analytics.created_at) BETWEEN %s AND %s'; 198 } elseif ($isDate && count($filterValue) !== 2) {209 } elseif ($isDate && \count($filterValue) !== 2) { 199 210 $startDate = $filterValue[0]; 200 211 $placeHolder[] = $startDate; … … 204 215 } 205 216 217 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- Table names from WordPress constants, date condition is built securely above, placeholder count varies by filter 206 218 $sql = $wpdb->prepare( 207 219 "SELECT … … 221 233 analytics.is_clicked = %d 222 234 AND 223 $dateCondition235 {$dateCondition} 224 236 GROUP BY 225 237 c.id", 226 238 $placeHolder 227 239 ); 228 240 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber 241 242 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Query is prepared above, direct query for analytics reporting 229 243 $results = $wpdb->get_results($sql); 230 244 … … 235 249 { 236 250 Analytics::delete(); 251 237 252 return Response::success('Analytics removed!'); 238 253 } -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/ApiWidgetController.php
r3342737 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 59 63 $domainExceptWWW = $domain; 60 64 } 61 $widget->where('domains', 'LIKE', '%' . parse_url($domainExceptWWW)['host'] . '%');65 $widget->where('domains', 'LIKE', '%' . wp_parse_url($domainExceptWWW)['host'] . '%'); 62 66 } else { 63 67 return; … … 78 82 { 79 83 $widgetChannels = WidgetChannel::where('status', 1)->where('widget_id', $widgetId)->orderBy('sequence')->get(['id', 'channel_name', 'config']); 80 if (! is_array($widgetChannels) || \count($widgetChannels) < 1) {81 return null;84 if (!\is_array($widgetChannels) || \count($widgetChannels) < 1) { 85 return; 82 86 } 83 87 -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/BitAssistAnalyticsController.php
r3090183 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Model\WidgetChannel; -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/DownloadController.php
r3243139 r3464745 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 5 9 use BitApps\Assist\Config; 10 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 6 11 use BitApps\Assist\Helpers\FileHandler; 7 12 8 13 final class DownloadController 9 14 { 10 public function downloadResponseFile( )15 public function downloadResponseFile(Request $request) 11 16 { 12 if (!function_exists('wp_check_filetype_and_ext')) { 13 require_once ABSPATH . 'wp-admin/includes/file.php'; 14 } 17 $validated = $request->validate([ 18 'widgetChannelID' => ['required', 'integer'], 19 'fileID' => ['required', 'string', 'sanitize:text'], 20 'fileName' => ['required', 'string', 'sanitize:text'], 21 'download' => ['nullable'], 22 ]); 15 23 16 $widgetChannelID = intval(sanitize_text_field($_GET['widgetChannelID'])); 17 18 $fileID = sanitize_text_field($_GET['fileID']); 19 20 $fileName = sanitize_text_field($_GET['fileName']); 21 22 $forceDownload = isset($_GET['download']); 24 $widgetChannelID = $validated['widgetChannelID']; 25 $fileID = $validated['fileID']; 26 $fileName = $validated['fileName']; 27 $forceDownload = isset($validated['download']); 23 28 24 29 if (empty($widgetChannelID) || empty($fileID) || empty($fileName)) { … … 44 49 private function fileDownloadORView($filePath, $fileName, $forceDownload = false) 45 50 { 51 global $wp_filesystem; 52 if (empty($wp_filesystem)) { 53 require_once ABSPATH . 'wp-admin/includes/file.php'; 54 WP_Filesystem(); 55 } 56 46 57 if ($forceDownload) { 47 58 header('Content-Type: application/force-download'); … … 54 65 if ($fileInfo['type'] && $fileInfo['ext']) { 55 66 $content_types = $fileInfo['type']; 56 if ( in_array($fileInfo['ext'], ['txt', 'php', 'html', 'xhtml', 'json'])) {67 if (\in_array($fileInfo['ext'], ['txt', 'php', 'html', 'xhtml', 'json'])) { 57 68 $content_types = 'text/plain'; 58 69 } 59 70 } 60 71 header('Content-Disposition:filename="' . $fileName . '"'); 61 header("Content-Type: $content_types");72 header("Content-Type: {$content_types}"); 62 73 } 63 74 … … 69 80 header('Content-Transfer-Encoding: binary '); 70 81 flush(); 71 readfile($filePath); 72 die(); 82 83 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Raw file content output for download/view, escaping would corrupt binary files. 84 echo $wp_filesystem->get_contents($filePath); 85 exit(); 73 86 } 74 87 -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/IframeController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 13 17 'clientDomain' => ['required', 'string', 'sanitize:text'], 14 18 ]); 15 19 16 20 $urlParts = explode('-protocol-bit-assist-', $validated['clientDomain']); 17 21 $protocol = $urlParts[0] === 'i' ? 'http://' : 'https://'; … … 26 30 } 27 31 28 echo <<<HTML29 <!DOCTYPE html> 30 <html lang="en"> 31 <head>32 <meta charset="UTF-8" />33 <meta name="viewport" content="width=device-width, initial-scale=1.0" />34 <title>Bit Assist Widget</title>35 <script crossorigin src="{$assetBase}/assets/index.js?ver={$version}"></script>36 <link rel="stylesheet" href="{$assetBase}/assets/index.css?ver={$version}">37 </head>38 <body>39 <div id="widgetWrapper" class="hide">40 <div id="contentWrapper" class="hide"></div>41 <div id="widgetBubbleRow">42 <div id="widgetBubbleWrapper">43 <button id="widgetBubble"><img alt="Widget Icon" id="widget-img" /></button>44 <span id="credit"><a href="https://www.bitapps.pro/bit-assist" rel="nofollow noreferrer noopener" target="_blank">by Bit Assist</a></span>45 </div>46 </div>47 </div>48 </body>49 </html> 50 HTML;32 echo '<!DOCTYPE html>'; 33 echo '<html lang="en">'; 34 echo '<head>'; 35 echo '<meta charset="UTF-8" />'; 36 echo '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'; 37 echo '<title>Bit Assist Widget</title>'; 38 // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript -- It can be outside of WordPress environment, so we can't rely on wp_enqueue_script. 39 echo '<script crossorigin src="' . esc_url($assetBase . '/assets/index.js?ver=' . $version) . '"></script>'; 40 // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- It can be outside of WordPress environment, so we can't rely on wp_enqueue_style. 41 echo '<link rel="stylesheet" href="' . esc_url($assetBase . '/assets/index.css?ver=' . $version) . '">'; 42 echo '</head>'; 43 echo '<body>'; 44 echo '<div id="widgetWrapper" class="hide">'; 45 echo '<div id="contentWrapper" class="hide"></div>'; 46 echo '<div id="widgetBubbleRow">'; 47 echo '<div id="widgetBubbleWrapper">'; 48 echo '<button id="widgetBubble"><img alt="Widget Icon" id="widget-img" /></button>'; 49 echo '<span id="credit"><a href="https://www.bitapps.pro/bit-assist" rel="nofollow noreferrer noopener" target="_blank">by Bit Assist</a></span>'; 50 echo '</div>'; 51 echo '</div>'; 52 echo '</div>'; 53 echo '</body>'; 54 echo '</html>'; 51 55 52 56 status_header(200); -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/ResponseController.php
r3243139 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/WPPostController.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/WidgetChannelController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 183 187 { 184 188 $validated['config']['title'] = sanitize_text_field($validated['config']['title']); 189 185 190 return $validated; 186 191 } -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/WidgetController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/WooChannelController.php
r3429564 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 22 26 $order_id = sanitize_text_field($request->get('number')); 23 27 $billing_email = sanitize_email($request->get('email')); 24 $widget_channel_id = intval($request->get('widget_channel_id'));28 $widget_channel_id = \intval($request->get('widget_channel_id')); 25 29 26 30 if (!$order_id) { -
bit-assist/tags/1.6.1/backend/app/HTTP/Controllers/WpSearchController.php
r3342879 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 29 33 private function getPageAndPosts($search, $page, $postTypes) 30 34 { 31 $paged = max(1, intval($page));35 $paged = max(1, \intval($page)); 32 36 $search = trim($search); 33 37 … … 71 75 ]; 72 76 }, array_filter($posts, function ($post) { 73 return $post && is_object($post);77 return $post && \is_object($post); 74 78 })); 75 79 } -
bit-assist/tags/1.6.1/backend/app/HTTP/Middleware/AdminCheckerMiddleware.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; -
bit-assist/tags/1.6.1/backend/app/HTTP/Middleware/LoggedInCheckerMiddleware.php
r3407659 r3464745 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 4 5 // Prevent direct script access 6 if (!\defined('ABSPATH')) { 5 if (!defined('ABSPATH')) { 7 6 exit; 8 7 } -
bit-assist/tags/1.6.1/backend/app/HTTP/Middleware/NonceCheckerMiddleware.php
r3195774 r3464745 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; 6 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request;7 11 8 12 final class NonceCheckerMiddleware -
bit-assist/tags/1.6.1/backend/app/HTTP/Requests/WidgetChannelStoreRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/tags/1.6.1/backend/app/HTTP/Requests/WidgetChannelUpdateRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/tags/1.6.1/backend/app/HTTP/Requests/WidgetStoreRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/tags/1.6.1/backend/app/HTTP/Requests/WidgetUpdateRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/tags/1.6.1/backend/app/Helpers/FileHandler.php
r3299751 r3464745 2 2 3 3 namespace BitApps\Assist\Helpers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 19 23 $file_uploaded = []; 20 24 21 if ( is_array($fileDetails['name'])) {25 if (\is_array($fileDetails['name'])) { 22 26 foreach ($fileDetails['name'] as $key => $fileName) { 23 27 $fileData = $this->saveFile($_upload_dir, $fileDetails['tmp_name'][$key], $fileName); … … 45 49 } 46 50 51 public function deleteFiles($widgetChannelID, $files) 52 { 53 $_upload_dir = Config::get('UPLOAD_DIR') . DIRECTORY_SEPARATOR . $widgetChannelID; 54 foreach ($files as $name) { 55 wp_delete_file($_upload_dir . DIRECTORY_SEPARATOR . $name); 56 } 57 } 58 47 59 private function saveFile($_upload_dir, $tmpName, $fileName) 48 60 { … … 54 66 $file_uploaded = ['uniqueName' => $uniqueFileName, 'originalName' => $fileName]; 55 67 56 $move_status = \move_uploaded_file($tmpName, $_upload_dir . DIRECTORY_SEPARATOR . $uniqueFileName); 68 global $wp_filesystem; 69 if (empty($wp_filesystem)) { 70 require_once ABSPATH . 'wp-admin/includes/file.php'; 71 WP_Filesystem(); 72 } 73 74 $destination = $_upload_dir . DIRECTORY_SEPARATOR . $uniqueFileName; 75 $move_status = $wp_filesystem->move($tmpName, $destination, true); 76 57 77 if (!$move_status) { 58 78 return false; 59 79 } 80 60 81 return $file_uploaded; 61 82 } 62 63 public function deleteFiles($widgetChannelID, $files)64 {65 $_upload_dir = Config::get('UPLOAD_DIR') . DIRECTORY_SEPARATOR . $widgetChannelID;66 foreach ($files as $name) {67 unlink($_upload_dir . DIRECTORY_SEPARATOR . $name);68 }69 }70 83 } -
bit-assist/tags/1.6.1/backend/app/Model/Analytics.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/Model/Response.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/Model/Widget.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 9 13 { 10 14 protected $prefix = Config::VAR_PREFIX; 11 15 12 16 protected $casts = [ 13 17 'styles' => 'object', -
bit-assist/tags/1.6.1/backend/app/Model/WidgetChannel.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/Plugin.php
r3407659 r3464745 2 2 3 3 namespace BitApps\Assist; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 /* … … 9 13 */ 10 14 11 use BitApps\Assist\Deps\BitApps\WPKit\Migration\MigrationHelper;12 15 use BitApps\Assist\Deps\BitApps\WPKit\Hooks\Hooks; 13 16 use BitApps\Assist\Deps\BitApps\WPKit\Http\RequestType; 17 use BitApps\Assist\Deps\BitApps\WPKit\Migration\MigrationHelper; 14 18 use BitApps\Assist\Deps\BitApps\WPKit\Utils\Capabilities; 15 19 use BitApps\Assist\Deps\BitApps\WPTelemetry\Telemetry\Telemetry; … … 67 71 /** 68 72 * Add schedule to cleanup analytics if the plugin version is less than or equal to 1.5.3 73 * 69 74 * @since 1.5.4 70 75 */ -
bit-assist/tags/1.6.1/backend/app/Providers/HookProvider.php
r3407659 r3464745 2 2 3 3 namespace BitApps\Assist\Providers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/Providers/InstallerProvider.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Providers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/tags/1.6.1/backend/app/Views/Layout.php
r3195774 r3464745 41 41 $menu['capability'], 42 42 $menu['slug'], 43 is_string($menu['callback']) ? (method_exists($this, $menu['callback']) ? [$this, $menu['callback']] : $menu['callback']) : $menu['callback'],43 \is_string($menu['callback']) ? (method_exists($this, $menu['callback']) ? [$this, $menu['callback']] : $menu['callback']) : $menu['callback'], 44 44 $menu['icon'], 45 45 $menu['position'] … … 68 68 69 69 // loading google fonts 70 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- External font resource version managed by Google 70 71 wp_enqueue_style('googleapis-PRECONNECT', 'https://fonts.googleapis.com'); 72 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- External font resource version managed by Google 71 73 wp_enqueue_style('gstatic-PRECONNECT-CROSSORIGIN', 'https://fonts.gstatic.com'); 72 74 wp_enqueue_style('font', self::FONT_URL, [], $version); … … 75 77 76 78 if (Config::isDev()) { 79 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 77 80 wp_enqueue_script($slug . '-vite-client-helper-MODULE', Config::DEV_URL . '/config/devHotModule.js', [], null); 81 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 78 82 wp_enqueue_script($slug . '-vite-client-MODULE', Config::DEV_URL . '/@vite/client', [], null); 83 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 79 84 wp_enqueue_script($slug . '-index-MODULE', Config::DEV_URL . '/index.tsx', [], null); 80 85 } else { 86 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter -- Main app script must load in header for proper initialization 81 87 wp_enqueue_script($slug . '-index-MODULE', $assetUri . '/index.js', [], $version); 82 88 wp_enqueue_style($slug . '-styles', $assetUri . '/index.css', null, $version); … … 132 138 $rootURL = Config::get('ROOT_URI'); 133 139 134 // phpcs:disable Generic.PHP.ForbiddenFunctions.Found 135 136 echo <<<HTML 137 <noscript>You need to enable JavaScript to run this app.</noscript> 138 <div id="bit-apps-root"> 139 <div 140 style="display: flex;flex-direction: column;justify-content: center; 141 align-items: center;height: 90vh;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;"> 142 <img alt="bit-assist-logo" class="bit-logo" width="70" src="{$rootURL}/img/logo.svg"> 143 <h1>Welcome to Bit Assist</h1> 144 <p></p> 145 </div> 146 </div> 147 HTML; 140 echo '<noscript>You need to enable JavaScript to run this app.</noscript>'; 141 echo '<div id="bit-apps-root">'; 142 echo '<div style="display: flex;flex-direction: column;justify-content: center;'; 143 echo 'align-items: center;height: 90vh;font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif;">'; 144 echo '<img alt="bit-assist-logo" class="bit-logo" width="70" src="' . esc_url($rootURL . '/img/logo.svg') . '">'; 145 echo '<h1>Welcome to Bit Assist</h1>'; 146 echo '<p></p>'; 147 echo '</div>'; 148 echo '</div>'; 148 149 } 149 150 … … 212 213 public function createConfigVariable() 213 214 { 215 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Hook name is prefixed via Config::withPrefix() 214 216 $frontendVars = apply_filters( 215 217 Config::withPrefix('localized_script'), … … 228 230 ] 229 231 ); 232 // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 230 233 if (get_locale() !== 'en_US' && file_exists(Config::get('BASEDIR') . '/languages/generatedString.php')) { 231 234 include_once Config::get('BASEDIR') . '/languages/generatedString.php'; -
bit-assist/tags/1.6.1/backend/bootstrap.php
r2814120 r3464745 1 1 <?php 2 2 3 if (! \defined('ABSPATH')) {3 if (!defined('ABSPATH')) { 4 4 exit; 5 5 } -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTAnalyticsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTAnalyticsTableMigration extends Migration 13 14 { -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTPluginOptions.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; … … 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 10 7 if (!\defined('ABSPATH')) { 8 exit; 9 } 10 11 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 11 12 final class BASTPluginOptions extends Migration 12 13 { -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTResponsesTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTResponsesTableMigration extends Migration 13 14 { -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTUpdateCustomCssColumnInWidgetTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 5 9 6 if (!\defined('ABSPATH')) { 7 exit; 8 } 9 10 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 10 11 final class BASTUpdateCustomCssColumnInWidgetTableMigration extends Migration 11 12 { … … 18 19 global $wpdb; 19 20 $table_name = Config::withDBPrefix('widgets'); 20 $sql = "ALTER TABLE $table_name MODIFY COLUMN custom_css LONGTEXT NULL;"; 21 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements 22 $sql = "ALTER TABLE {$table_name} MODIFY COLUMN custom_css LONGTEXT NULL;"; 23 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements, direct DB query required for migration 21 24 $wpdb->query($sql); 22 25 } … … 30 33 global $wpdb; 31 34 $table_name = Config::withDBPrefix('widgets'); 32 $sql = "ALTER TABLE $table_name MODIFY COLUMN custom_css VARCHAR(255) NULL;"; 35 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements 36 $sql = "ALTER TABLE {$table_name} MODIFY COLUMN custom_css VARCHAR(255) NULL;"; 37 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements, direct DB query required for migration 33 38 $wpdb->query($sql); 34 39 } -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTUpdateOptions.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 5 9 6 if (!\defined('ABSPATH')) { 7 exit; 8 } 9 10 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 10 11 final class BASTUpdateOptions extends Migration 11 12 { … … 18 19 public function down() 19 20 { 20 return;21 21 } 22 22 } -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTWidgetChannelsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTWidgetChannelsTableMigration extends Migration 13 14 { -
bit-assist/tags/1.6.1/backend/db/Migrations/BASTWidgetsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTWidgetsTableMigration extends Migration 13 14 { -
bit-assist/tags/1.6.1/backend/hooks/ajax.php
r3241612 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Deps\BitApps\WPKit\Http\Router\Route; … … 8 12 use BitApps\Assist\HTTP\Controllers\WidgetController; 9 13 use BitApps\Assist\HTTP\Controllers\WPPostController; 10 11 if (!\defined('ABSPATH')) {12 exit;13 }14 14 15 15 // if (!headers_sent()) { -
bit-assist/tags/1.6.1/backend/hooks/api.php
r3407659 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Deps\BitApps\WPKit\Http\Router\Route; … … 5 9 use BitApps\Assist\HTTP\Controllers\ApiWidgetController; 6 10 use BitApps\Assist\HTTP\Controllers\IframeController; 11 use BitApps\Assist\HTTP\Controllers\ResponseController; 7 12 use BitApps\Assist\HTTP\Controllers\WooChannelController; 8 use BitApps\Assist\HTTP\Controllers\ResponseController;9 13 use BitApps\Assist\HTTP\Controllers\WpSearchController; 10 11 if (!\defined('ABSPATH')) {12 exit;13 }14 14 15 15 Route::group(function () { -
bit-assist/tags/1.6.1/index.php
r3429564 r3464745 5 5 * Plugin URI: https://bitapps.pro/bit-assist 6 6 * Description: WhatsApp,Facebook Messenger chat, click to chat Live Chat Widget,Call button & 30+ social chat support button for customer support with sticky chat button 7 * Version: 1.6. 07 * Version: 1.6.1 8 8 * Author: Bit Assist - Click to Chat Widget Live Chat Support Chat Button 9 9 * Author URI: https://bitapps.pro … … 14 14 * License: gpl2+ 15 15 */ 16 if (!defined('ABSPATH')) { 17 exit; 18 } 19 16 20 require_once plugin_dir_path(__FILE__) . 'backend/bootstrap.php'; -
bit-assist/tags/1.6.1/readme.txt
r3429564 r3464745 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1.6. 08 Stable tag: 1.6.1 9 9 License: GPLv2 or later 10 10 … … 349 349 350 350 == Changelog == 351 = v1.6.1 (Feb 19, 2026) = 352 * Fix: WordPress Plugin Checker issues fixed. 353 351 354 = v1.6.0 (Dec 30, 2025) = 352 355 * Fix: WooCommerce order details can now only be viewed by the user who placed the order. -
bit-assist/tags/1.6.1/vendor/composer/installed.php
r3429564 r3464745 2 2 'root' => array( 3 3 'name' => 'bitapps/assist', 4 'pretty_version' => '1.6. 0',5 'version' => '1.6. 0.0',6 'reference' => ' 88cb852704f8f67eb6e264dbe8a16b757d0147a9',4 'pretty_version' => '1.6.1', 5 'version' => '1.6.1.0', 6 'reference' => '0428cad0defb425d7b7e89022c5d9ddd47ce7542', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'bitapps/assist' => array( 14 'pretty_version' => '1.6. 0',15 'version' => '1.6. 0.0',16 'reference' => ' 88cb852704f8f67eb6e264dbe8a16b757d0147a9',14 'pretty_version' => '1.6.1', 15 'version' => '1.6.1.0', 16 'reference' => '0428cad0defb425d7b7e89022c5d9ddd47ce7542', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
bit-assist/trunk/backend/app/Config.php
r3429564 r3464745 5 5 namespace BitApps\Assist; 6 6 7 use BitApps\AssistPro\Config as ProConfig; 8 9 if (!\defined('ABSPATH')) { 7 if (!defined('ABSPATH')) { 10 8 exit; 11 9 } 10 11 use BitApps\AssistPro\Config as ProConfig; 12 12 13 13 /** … … 22 22 public const VAR_PREFIX = 'bit_assist_'; 23 23 24 public const VERSION = '1.6. 0';24 public const VERSION = '1.6.1'; 25 25 26 26 public const DB_VERSION = '1.0.3'; … … 60 60 61 61 case 'SITE_URL': 62 $parsedUrl = parse_url(get_admin_url());62 $parsedUrl = wp_parse_url(get_admin_url()); 63 63 $siteUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host']; 64 64 $siteUrl .= empty($parsedUrl['port']) ? null : ':' . $parsedUrl['port']; … … 67 67 68 68 case 'SITE_DOMAIN': 69 $parsedUrl = parse_url(get_admin_url());69 $parsedUrl = wp_parse_url(get_admin_url()); 70 70 71 71 return $parsedUrl['host']; … … 187 187 public static function isDev() 188 188 { 189 return \defined('BITAPPS_DEV') && BITAPPS_DEV;189 return defined('BITAPPS_DEV') && BITAPPS_DEV; 190 190 } 191 191 -
bit-assist/trunk/backend/app/HTTP/Controllers/AnalyticsController.php
r3241612 r3464745 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 9 use AllowDynamicProperties; 5 10 use BitApps\Assist\Config; 6 use AllowDynamicProperties; 11 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 12 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; 7 13 use BitApps\Assist\Model\Analytics; 8 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response;9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request;10 14 11 15 #[AllowDynamicProperties] … … 16 20 $analyticsOption = Config::getOption('analytics_activate'); 17 21 18 return $analyticsOption ? (int) $analyticsOption : 0;22 return $analyticsOption ? (int) $analyticsOption : 0; 19 23 } 20 24 … … 86 90 $iterations = 0; 87 91 88 $cutoff = date('Y-m-d H:i:s', strtotime("-{$retentionDays} days"));92 $cutoff = gmdate('Y-m-d H:i:s', strtotime("-{$retentionDays} days")); 89 93 90 94 $table = $wpdb->prefix . Config::VAR_PREFIX . 'analytics'; 91 95 96 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.PreparedSQL.NotPrepared -- Table name from WordPress constants, cutoff is a valid date string, batch size is a valid integer 92 97 $preparedQuery = $wpdb->prepare( 93 98 "DELETE FROM {$table} WHERE created_at < %s LIMIT %d", … … 97 102 98 103 /** 99 * If the number of records deleted in a batch is equal to the batch size,100 * and the number of iterations is less than the maximum number of iterations,101 * continue deleting records in batches.102 */104 * If the number of records deleted in a batch is equal to the batch size, 105 * and the number of iterations is less than the maximum number of iterations, 106 * continue deleting records in batches. 107 */ 103 108 do { 109 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 104 110 $deletedCount = $wpdb->query($preparedQuery); 105 111 … … 115 121 $isDate = preg_match($datePattern, $filterValue) === 1; 116 122 117 $startDate = date('Y-m-d');118 $endDate = date('Y-m-d');123 $startDate = gmdate('Y-m-d'); 124 $endDate = gmdate('Y-m-d'); 119 125 $dateRange = []; 120 126 … … 125 131 $placeHolder = [0, 1, 0, 1, 1, 0, 0, 1]; 126 132 133 // Build the date condition SQL 127 134 $dateCondition = ''; 128 135 if ($filterValue === '7days') { … … 132 139 } elseif ($filterValue === 'today') { 133 140 $dateCondition = 'DATE(analytics.created_at) = CURDATE()'; 134 } elseif ($isDate && isset($dateRange[0] ) && isset($dateRange[1])) {141 } elseif ($isDate && isset($dateRange[0], $dateRange[1])) { 135 142 $startDate = $dateRange[0]; 136 143 $endDate = $dateRange[1]; … … 138 145 $placeHolder[] = $endDate; 139 146 $dateCondition = 'DATE(analytics.created_at) BETWEEN %s AND %s'; 140 } elseif ($isDate && count($dateRange) !== 2) {147 } elseif ($isDate && \count($dateRange) !== 2) { 141 148 $startDate = $dateRange[0]; 142 149 $placeHolder[] = $startDate; … … 146 153 } 147 154 155 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- Table names from WordPress constants, date condition is built securely above, placeholder count varies by filter 148 156 $sql = $wpdb->prepare( 149 157 "SELECT … … 158 166 (analytics.channel_id IS NULL AND (analytics.is_clicked = %d OR analytics.is_clicked = %d)) 159 167 AND 160 $dateCondition168 {$dateCondition} 161 169 GROUP BY 162 170 analytics.widget_id, widgets.name", 163 171 $placeHolder 164 172 ); 165 173 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber 174 175 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Query is prepared above, direct query for analytics reporting 166 176 $widgetAnalyticsData = $wpdb->get_results($sql); 167 177 … … 176 186 $filterValue = $request->filter; 177 187 $datePattern = '/\d{4}-\d{2}-\d{2}/'; 178 $isDate = is_array($filterValue) ? preg_match($datePattern, $filterValue[0]) === 1 : false;179 180 $startDate = date('Y-m-d');181 $endDate = date('Y-m-d');188 $isDate = \is_array($filterValue) ? preg_match($datePattern, $filterValue[0]) === 1 : false; 189 190 $startDate = gmdate('Y-m-d'); 191 $endDate = gmdate('Y-m-d'); 182 192 183 193 $placeHolder = [1, 0, 1, 0, $widget_id, 1]; 184 194 195 // Build the date condition SQL 185 196 $dateCondition = ''; 186 197 if ($filterValue === '7days') { … … 190 201 } elseif ($filterValue === 'today') { 191 202 $dateCondition = 'DATE(analytics.created_at) = CURDATE()'; 192 } elseif ($isDate && isset($filterValue[0] ) && isset($filterValue[1])) {203 } elseif ($isDate && isset($filterValue[0], $filterValue[1])) { 193 204 $startDate = $filterValue[0]; 194 205 $endDate = $filterValue[1]; … … 196 207 $placeHolder[] = $endDate; 197 208 $dateCondition = 'DATE(analytics.created_at) BETWEEN %s AND %s'; 198 } elseif ($isDate && count($filterValue) !== 2) {209 } elseif ($isDate && \count($filterValue) !== 2) { 199 210 $startDate = $filterValue[0]; 200 211 $placeHolder[] = $startDate; … … 204 215 } 205 216 217 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- Table names from WordPress constants, date condition is built securely above, placeholder count varies by filter 206 218 $sql = $wpdb->prepare( 207 219 "SELECT … … 221 233 analytics.is_clicked = %d 222 234 AND 223 $dateCondition235 {$dateCondition} 224 236 GROUP BY 225 237 c.id", 226 238 $placeHolder 227 239 ); 228 240 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber 241 242 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Query is prepared above, direct query for analytics reporting 229 243 $results = $wpdb->get_results($sql); 230 244 … … 235 249 { 236 250 Analytics::delete(); 251 237 252 return Response::success('Analytics removed!'); 238 253 } -
bit-assist/trunk/backend/app/HTTP/Controllers/ApiWidgetController.php
r3342737 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 59 63 $domainExceptWWW = $domain; 60 64 } 61 $widget->where('domains', 'LIKE', '%' . parse_url($domainExceptWWW)['host'] . '%');65 $widget->where('domains', 'LIKE', '%' . wp_parse_url($domainExceptWWW)['host'] . '%'); 62 66 } else { 63 67 return; … … 78 82 { 79 83 $widgetChannels = WidgetChannel::where('status', 1)->where('widget_id', $widgetId)->orderBy('sequence')->get(['id', 'channel_name', 'config']); 80 if (! is_array($widgetChannels) || \count($widgetChannels) < 1) {81 return null;84 if (!\is_array($widgetChannels) || \count($widgetChannels) < 1) { 85 return; 82 86 } 83 87 -
bit-assist/trunk/backend/app/HTTP/Controllers/BitAssistAnalyticsController.php
r3090183 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Model\WidgetChannel; -
bit-assist/trunk/backend/app/HTTP/Controllers/DownloadController.php
r3243139 r3464745 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 5 9 use BitApps\Assist\Config; 10 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 6 11 use BitApps\Assist\Helpers\FileHandler; 7 12 8 13 final class DownloadController 9 14 { 10 public function downloadResponseFile( )15 public function downloadResponseFile(Request $request) 11 16 { 12 if (!function_exists('wp_check_filetype_and_ext')) { 13 require_once ABSPATH . 'wp-admin/includes/file.php'; 14 } 17 $validated = $request->validate([ 18 'widgetChannelID' => ['required', 'integer'], 19 'fileID' => ['required', 'string', 'sanitize:text'], 20 'fileName' => ['required', 'string', 'sanitize:text'], 21 'download' => ['nullable'], 22 ]); 15 23 16 $widgetChannelID = intval(sanitize_text_field($_GET['widgetChannelID'])); 17 18 $fileID = sanitize_text_field($_GET['fileID']); 19 20 $fileName = sanitize_text_field($_GET['fileName']); 21 22 $forceDownload = isset($_GET['download']); 24 $widgetChannelID = $validated['widgetChannelID']; 25 $fileID = $validated['fileID']; 26 $fileName = $validated['fileName']; 27 $forceDownload = isset($validated['download']); 23 28 24 29 if (empty($widgetChannelID) || empty($fileID) || empty($fileName)) { … … 44 49 private function fileDownloadORView($filePath, $fileName, $forceDownload = false) 45 50 { 51 global $wp_filesystem; 52 if (empty($wp_filesystem)) { 53 require_once ABSPATH . 'wp-admin/includes/file.php'; 54 WP_Filesystem(); 55 } 56 46 57 if ($forceDownload) { 47 58 header('Content-Type: application/force-download'); … … 54 65 if ($fileInfo['type'] && $fileInfo['ext']) { 55 66 $content_types = $fileInfo['type']; 56 if ( in_array($fileInfo['ext'], ['txt', 'php', 'html', 'xhtml', 'json'])) {67 if (\in_array($fileInfo['ext'], ['txt', 'php', 'html', 'xhtml', 'json'])) { 57 68 $content_types = 'text/plain'; 58 69 } 59 70 } 60 71 header('Content-Disposition:filename="' . $fileName . '"'); 61 header("Content-Type: $content_types");72 header("Content-Type: {$content_types}"); 62 73 } 63 74 … … 69 80 header('Content-Transfer-Encoding: binary '); 70 81 flush(); 71 readfile($filePath); 72 die(); 82 83 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Raw file content output for download/view, escaping would corrupt binary files. 84 echo $wp_filesystem->get_contents($filePath); 85 exit(); 73 86 } 74 87 -
bit-assist/trunk/backend/app/HTTP/Controllers/IframeController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 13 17 'clientDomain' => ['required', 'string', 'sanitize:text'], 14 18 ]); 15 19 16 20 $urlParts = explode('-protocol-bit-assist-', $validated['clientDomain']); 17 21 $protocol = $urlParts[0] === 'i' ? 'http://' : 'https://'; … … 26 30 } 27 31 28 echo <<<HTML29 <!DOCTYPE html> 30 <html lang="en"> 31 <head>32 <meta charset="UTF-8" />33 <meta name="viewport" content="width=device-width, initial-scale=1.0" />34 <title>Bit Assist Widget</title>35 <script crossorigin src="{$assetBase}/assets/index.js?ver={$version}"></script>36 <link rel="stylesheet" href="{$assetBase}/assets/index.css?ver={$version}">37 </head>38 <body>39 <div id="widgetWrapper" class="hide">40 <div id="contentWrapper" class="hide"></div>41 <div id="widgetBubbleRow">42 <div id="widgetBubbleWrapper">43 <button id="widgetBubble"><img alt="Widget Icon" id="widget-img" /></button>44 <span id="credit"><a href="https://www.bitapps.pro/bit-assist" rel="nofollow noreferrer noopener" target="_blank">by Bit Assist</a></span>45 </div>46 </div>47 </div>48 </body>49 </html> 50 HTML;32 echo '<!DOCTYPE html>'; 33 echo '<html lang="en">'; 34 echo '<head>'; 35 echo '<meta charset="UTF-8" />'; 36 echo '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'; 37 echo '<title>Bit Assist Widget</title>'; 38 // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript -- It can be outside of WordPress environment, so we can't rely on wp_enqueue_script. 39 echo '<script crossorigin src="' . esc_url($assetBase . '/assets/index.js?ver=' . $version) . '"></script>'; 40 // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- It can be outside of WordPress environment, so we can't rely on wp_enqueue_style. 41 echo '<link rel="stylesheet" href="' . esc_url($assetBase . '/assets/index.css?ver=' . $version) . '">'; 42 echo '</head>'; 43 echo '<body>'; 44 echo '<div id="widgetWrapper" class="hide">'; 45 echo '<div id="contentWrapper" class="hide"></div>'; 46 echo '<div id="widgetBubbleRow">'; 47 echo '<div id="widgetBubbleWrapper">'; 48 echo '<button id="widgetBubble"><img alt="Widget Icon" id="widget-img" /></button>'; 49 echo '<span id="credit"><a href="https://www.bitapps.pro/bit-assist" rel="nofollow noreferrer noopener" target="_blank">by Bit Assist</a></span>'; 50 echo '</div>'; 51 echo '</div>'; 52 echo '</div>'; 53 echo '</body>'; 54 echo '</html>'; 51 55 52 56 status_header(200); -
bit-assist/trunk/backend/app/HTTP/Controllers/ResponseController.php
r3243139 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/HTTP/Controllers/WPPostController.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; -
bit-assist/trunk/backend/app/HTTP/Controllers/WidgetChannelController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 183 187 { 184 188 $validated['config']['title'] = sanitize_text_field($validated['config']['title']); 189 185 190 return $validated; 186 191 } -
bit-assist/trunk/backend/app/HTTP/Controllers/WidgetController.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/HTTP/Controllers/WooChannelController.php
r3429564 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 22 26 $order_id = sanitize_text_field($request->get('number')); 23 27 $billing_email = sanitize_email($request->get('email')); 24 $widget_channel_id = intval($request->get('widget_channel_id'));28 $widget_channel_id = \intval($request->get('widget_channel_id')); 25 29 26 30 if (!$order_id) { -
bit-assist/trunk/backend/app/HTTP/Controllers/WpSearchController.php
r3342879 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Controllers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use AllowDynamicProperties; … … 29 33 private function getPageAndPosts($search, $page, $postTypes) 30 34 { 31 $paged = max(1, intval($page));35 $paged = max(1, \intval($page)); 32 36 $search = trim($search); 33 37 … … 71 75 ]; 72 76 }, array_filter($posts, function ($post) { 73 return $post && is_object($post);77 return $post && \is_object($post); 74 78 })); 75 79 } -
bit-assist/trunk/backend/app/HTTP/Middleware/AdminCheckerMiddleware.php
r3241612 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; -
bit-assist/trunk/backend/app/HTTP/Middleware/LoggedInCheckerMiddleware.php
r3407659 r3464745 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 4 5 // Prevent direct script access 6 if (!\defined('ABSPATH')) { 5 if (!defined('ABSPATH')) { 7 6 exit; 8 7 } -
bit-assist/trunk/backend/app/HTTP/Middleware/NonceCheckerMiddleware.php
r3195774 r3464745 3 3 namespace BitApps\Assist\HTTP\Middleware; 4 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 8 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Http\Response; 6 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request;7 11 8 12 final class NonceCheckerMiddleware -
bit-assist/trunk/backend/app/HTTP/Requests/WidgetChannelStoreRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/trunk/backend/app/HTTP/Requests/WidgetChannelUpdateRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/trunk/backend/app/HTTP/Requests/WidgetStoreRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/trunk/backend/app/HTTP/Requests/WidgetUpdateRequest.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\HTTP\Requests; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Http\Request\Request; -
bit-assist/trunk/backend/app/Helpers/FileHandler.php
r3299751 r3464745 2 2 3 3 namespace BitApps\Assist\Helpers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 19 23 $file_uploaded = []; 20 24 21 if ( is_array($fileDetails['name'])) {25 if (\is_array($fileDetails['name'])) { 22 26 foreach ($fileDetails['name'] as $key => $fileName) { 23 27 $fileData = $this->saveFile($_upload_dir, $fileDetails['tmp_name'][$key], $fileName); … … 45 49 } 46 50 51 public function deleteFiles($widgetChannelID, $files) 52 { 53 $_upload_dir = Config::get('UPLOAD_DIR') . DIRECTORY_SEPARATOR . $widgetChannelID; 54 foreach ($files as $name) { 55 wp_delete_file($_upload_dir . DIRECTORY_SEPARATOR . $name); 56 } 57 } 58 47 59 private function saveFile($_upload_dir, $tmpName, $fileName) 48 60 { … … 54 66 $file_uploaded = ['uniqueName' => $uniqueFileName, 'originalName' => $fileName]; 55 67 56 $move_status = \move_uploaded_file($tmpName, $_upload_dir . DIRECTORY_SEPARATOR . $uniqueFileName); 68 global $wp_filesystem; 69 if (empty($wp_filesystem)) { 70 require_once ABSPATH . 'wp-admin/includes/file.php'; 71 WP_Filesystem(); 72 } 73 74 $destination = $_upload_dir . DIRECTORY_SEPARATOR . $uniqueFileName; 75 $move_status = $wp_filesystem->move($tmpName, $destination, true); 76 57 77 if (!$move_status) { 58 78 return false; 59 79 } 80 60 81 return $file_uploaded; 61 82 } 62 63 public function deleteFiles($widgetChannelID, $files)64 {65 $_upload_dir = Config::get('UPLOAD_DIR') . DIRECTORY_SEPARATOR . $widgetChannelID;66 foreach ($files as $name) {67 unlink($_upload_dir . DIRECTORY_SEPARATOR . $name);68 }69 }70 83 } -
bit-assist/trunk/backend/app/Model/Analytics.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/Model/Response.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/Model/Widget.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; … … 9 13 { 10 14 protected $prefix = Config::VAR_PREFIX; 11 15 12 16 protected $casts = [ 13 17 'styles' => 'object', -
bit-assist/trunk/backend/app/Model/WidgetChannel.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Model; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/Plugin.php
r3407659 r3464745 2 2 3 3 namespace BitApps\Assist; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 /* … … 9 13 */ 10 14 11 use BitApps\Assist\Deps\BitApps\WPKit\Migration\MigrationHelper;12 15 use BitApps\Assist\Deps\BitApps\WPKit\Hooks\Hooks; 13 16 use BitApps\Assist\Deps\BitApps\WPKit\Http\RequestType; 17 use BitApps\Assist\Deps\BitApps\WPKit\Migration\MigrationHelper; 14 18 use BitApps\Assist\Deps\BitApps\WPKit\Utils\Capabilities; 15 19 use BitApps\Assist\Deps\BitApps\WPTelemetry\Telemetry\Telemetry; … … 67 71 /** 68 72 * Add schedule to cleanup analytics if the plugin version is less than or equal to 1.5.3 73 * 69 74 * @since 1.5.4 70 75 */ -
bit-assist/trunk/backend/app/Providers/HookProvider.php
r3407659 r3464745 2 2 3 3 namespace BitApps\Assist\Providers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/Providers/InstallerProvider.php
r3195774 r3464745 2 2 3 3 namespace BitApps\Assist\Providers; 4 5 if (!defined('ABSPATH')) { 6 exit; 7 } 4 8 5 9 use BitApps\Assist\Config; -
bit-assist/trunk/backend/app/Views/Layout.php
r3195774 r3464745 41 41 $menu['capability'], 42 42 $menu['slug'], 43 is_string($menu['callback']) ? (method_exists($this, $menu['callback']) ? [$this, $menu['callback']] : $menu['callback']) : $menu['callback'],43 \is_string($menu['callback']) ? (method_exists($this, $menu['callback']) ? [$this, $menu['callback']] : $menu['callback']) : $menu['callback'], 44 44 $menu['icon'], 45 45 $menu['position'] … … 68 68 69 69 // loading google fonts 70 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- External font resource version managed by Google 70 71 wp_enqueue_style('googleapis-PRECONNECT', 'https://fonts.googleapis.com'); 72 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- External font resource version managed by Google 71 73 wp_enqueue_style('gstatic-PRECONNECT-CROSSORIGIN', 'https://fonts.gstatic.com'); 72 74 wp_enqueue_style('font', self::FONT_URL, [], $version); … … 75 77 76 78 if (Config::isDev()) { 79 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 77 80 wp_enqueue_script($slug . '-vite-client-helper-MODULE', Config::DEV_URL . '/config/devHotModule.js', [], null); 81 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 78 82 wp_enqueue_script($slug . '-vite-client-MODULE', Config::DEV_URL . '/@vite/client', [], null); 83 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter, WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Dev mode hot reload script must load in header 79 84 wp_enqueue_script($slug . '-index-MODULE', Config::DEV_URL . '/index.tsx', [], null); 80 85 } else { 86 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter -- Main app script must load in header for proper initialization 81 87 wp_enqueue_script($slug . '-index-MODULE', $assetUri . '/index.js', [], $version); 82 88 wp_enqueue_style($slug . '-styles', $assetUri . '/index.css', null, $version); … … 132 138 $rootURL = Config::get('ROOT_URI'); 133 139 134 // phpcs:disable Generic.PHP.ForbiddenFunctions.Found 135 136 echo <<<HTML 137 <noscript>You need to enable JavaScript to run this app.</noscript> 138 <div id="bit-apps-root"> 139 <div 140 style="display: flex;flex-direction: column;justify-content: center; 141 align-items: center;height: 90vh;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;"> 142 <img alt="bit-assist-logo" class="bit-logo" width="70" src="{$rootURL}/img/logo.svg"> 143 <h1>Welcome to Bit Assist</h1> 144 <p></p> 145 </div> 146 </div> 147 HTML; 140 echo '<noscript>You need to enable JavaScript to run this app.</noscript>'; 141 echo '<div id="bit-apps-root">'; 142 echo '<div style="display: flex;flex-direction: column;justify-content: center;'; 143 echo 'align-items: center;height: 90vh;font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif;">'; 144 echo '<img alt="bit-assist-logo" class="bit-logo" width="70" src="' . esc_url($rootURL . '/img/logo.svg') . '">'; 145 echo '<h1>Welcome to Bit Assist</h1>'; 146 echo '<p></p>'; 147 echo '</div>'; 148 echo '</div>'; 148 149 } 149 150 … … 212 213 public function createConfigVariable() 213 214 { 215 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Hook name is prefixed via Config::withPrefix() 214 216 $frontendVars = apply_filters( 215 217 Config::withPrefix('localized_script'), … … 228 230 ] 229 231 ); 232 // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 230 233 if (get_locale() !== 'en_US' && file_exists(Config::get('BASEDIR') . '/languages/generatedString.php')) { 231 234 include_once Config::get('BASEDIR') . '/languages/generatedString.php'; -
bit-assist/trunk/backend/bootstrap.php
r2814120 r3464745 1 1 <?php 2 2 3 if (! \defined('ABSPATH')) {3 if (!defined('ABSPATH')) { 4 4 exit; 5 5 } -
bit-assist/trunk/backend/db/Migrations/BASTAnalyticsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTAnalyticsTableMigration extends Migration 13 14 { -
bit-assist/trunk/backend/db/Migrations/BASTPluginOptions.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; … … 5 9 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 10 7 if (!\defined('ABSPATH')) { 8 exit; 9 } 10 11 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 11 12 final class BASTPluginOptions extends Migration 12 13 { -
bit-assist/trunk/backend/db/Migrations/BASTResponsesTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTResponsesTableMigration extends Migration 13 14 { -
bit-assist/trunk/backend/db/Migrations/BASTUpdateCustomCssColumnInWidgetTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 5 9 6 if (!\defined('ABSPATH')) { 7 exit; 8 } 9 10 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 10 11 final class BASTUpdateCustomCssColumnInWidgetTableMigration extends Migration 11 12 { … … 18 19 global $wpdb; 19 20 $table_name = Config::withDBPrefix('widgets'); 20 $sql = "ALTER TABLE $table_name MODIFY COLUMN custom_css LONGTEXT NULL;"; 21 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements 22 $sql = "ALTER TABLE {$table_name} MODIFY COLUMN custom_css LONGTEXT NULL;"; 23 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements, direct DB query required for migration 21 24 $wpdb->query($sql); 22 25 } … … 30 33 global $wpdb; 31 34 $table_name = Config::withDBPrefix('widgets'); 32 $sql = "ALTER TABLE $table_name MODIFY COLUMN custom_css VARCHAR(255) NULL;"; 35 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements 36 $sql = "ALTER TABLE {$table_name} MODIFY COLUMN custom_css VARCHAR(255) NULL;"; 37 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Table name from trusted Config class, ALTER TABLE cannot use prepared statements, direct DB query required for migration 33 38 $wpdb->query($sql); 34 39 } -
bit-assist/trunk/backend/db/Migrations/BASTUpdateOptions.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 5 9 6 if (!\defined('ABSPATH')) { 7 exit; 8 } 9 10 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 10 11 final class BASTUpdateOptions extends Migration 11 12 { … … 18 19 public function down() 19 20 { 20 return;21 21 } 22 22 } -
bit-assist/trunk/backend/db/Migrations/BASTWidgetChannelsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTWidgetChannelsTableMigration extends Migration 13 14 { -
bit-assist/trunk/backend/db/Migrations/BASTWidgetsTableMigration.php
r3195774 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Config; 4 8 use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint; 9 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema; 5 10 use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration; 6 use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;7 11 8 if (!\defined('ABSPATH')) { 9 exit; 10 } 11 12 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention 12 13 final class BASTWidgetsTableMigration extends Migration 13 14 { -
bit-assist/trunk/backend/hooks/ajax.php
r3241612 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Deps\BitApps\WPKit\Http\Router\Route; … … 8 12 use BitApps\Assist\HTTP\Controllers\WidgetController; 9 13 use BitApps\Assist\HTTP\Controllers\WPPostController; 10 11 if (!\defined('ABSPATH')) {12 exit;13 }14 14 15 15 // if (!headers_sent()) { -
bit-assist/trunk/backend/hooks/api.php
r3407659 r3464745 1 1 <?php 2 3 if (!defined('ABSPATH')) { 4 exit; 5 } 2 6 3 7 use BitApps\Assist\Deps\BitApps\WPKit\Http\Router\Route; … … 5 9 use BitApps\Assist\HTTP\Controllers\ApiWidgetController; 6 10 use BitApps\Assist\HTTP\Controllers\IframeController; 11 use BitApps\Assist\HTTP\Controllers\ResponseController; 7 12 use BitApps\Assist\HTTP\Controllers\WooChannelController; 8 use BitApps\Assist\HTTP\Controllers\ResponseController;9 13 use BitApps\Assist\HTTP\Controllers\WpSearchController; 10 11 if (!\defined('ABSPATH')) {12 exit;13 }14 14 15 15 Route::group(function () { -
bit-assist/trunk/index.php
r3429564 r3464745 5 5 * Plugin URI: https://bitapps.pro/bit-assist 6 6 * Description: WhatsApp,Facebook Messenger chat, click to chat Live Chat Widget,Call button & 30+ social chat support button for customer support with sticky chat button 7 * Version: 1.6. 07 * Version: 1.6.1 8 8 * Author: Bit Assist - Click to Chat Widget Live Chat Support Chat Button 9 9 * Author URI: https://bitapps.pro … … 14 14 * License: gpl2+ 15 15 */ 16 if (!defined('ABSPATH')) { 17 exit; 18 } 19 16 20 require_once plugin_dir_path(__FILE__) . 'backend/bootstrap.php'; -
bit-assist/trunk/readme.txt
r3429564 r3464745 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1.6. 08 Stable tag: 1.6.1 9 9 License: GPLv2 or later 10 10 … … 349 349 350 350 == Changelog == 351 = v1.6.1 (Feb 19, 2026) = 352 * Fix: WordPress Plugin Checker issues fixed. 353 351 354 = v1.6.0 (Dec 30, 2025) = 352 355 * Fix: WooCommerce order details can now only be viewed by the user who placed the order. -
bit-assist/trunk/vendor/composer/installed.php
r3429564 r3464745 2 2 'root' => array( 3 3 'name' => 'bitapps/assist', 4 'pretty_version' => '1.6. 0',5 'version' => '1.6. 0.0',6 'reference' => ' 88cb852704f8f67eb6e264dbe8a16b757d0147a9',4 'pretty_version' => '1.6.1', 5 'version' => '1.6.1.0', 6 'reference' => '0428cad0defb425d7b7e89022c5d9ddd47ce7542', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'bitapps/assist' => array( 14 'pretty_version' => '1.6. 0',15 'version' => '1.6. 0.0',16 'reference' => ' 88cb852704f8f67eb6e264dbe8a16b757d0147a9',14 'pretty_version' => '1.6.1', 15 'version' => '1.6.1.0', 16 'reference' => '0428cad0defb425d7b7e89022c5d9ddd47ce7542', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.