1C-Bitrix Code Audit: Find Bottlenecks Before They Become Problems

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
1C-Bitrix Code Audit: Find Bottlenecks Before They Become Problems
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

1C-Bitrix Code Audit: Find Bottlenecks Before They Become Problems

A project on Bitrix starts lagging under load, a kernel update throws fatal errors, or a new team can’t make sense of custom code — these are typical symptoms that an independent code review uncovers. We perform code audits using modern PHP 8.1+, D7 API, and platform-specific best practices. Over 7 years we’ve completed more than 30 reviews for large marketplaces and e-commerce sites with thousands of products. As a result, clients save up to 2–3 months of development and avoid data breach fines. Request an audit to get an objective code assessment and a refactoring plan.

Why a Bitrix Code Review Is Necessary

A code review is not just bug hunting — it’s a systematic analysis of architecture, security, and performance. On the 1C-Bitrix platform, issues accumulate over years: using outdated APIs, lack of caching, direct data access without ORM. Regular audits keep technical debt under control and simplify kernel upgrades. Certified developers with seven years of experience ensure confidentiality and objectivity.

What Problems We Find

N+1 queries — the classic catalog component issue. Instead of one SQL query, additional N queries are fired for prices, images, and properties. This kills the database with 50+ products per page. SQL injections — direct user input concatenated into queries without escaping. Example: $_GET['id'] concatenated in CIBlockElement::GetList. One client avoided a major fine thanks to our review. XSS — outputting user data without htmlspecialchars(). Particularly dangerous in contact forms and personal accounts. Outdated APIs — code using the old kernel (e.g., CUser::GetByID) instead of the D7 API. D7 is 3x faster on typical queries.

Issue Type Occurrence in Projects Critical Cases
N+1 queries 80% 30%
SQL injections 45% 15%
XSS 60% 20%
Outdated APIs 90% 5%

Our Review Process

  1. Static analysis — PHPStan level 5–6 and PHP_CodeSniffer (PSR-12). Catches ~40% of issues automatically.
  2. Manual review — checking key subsystems: catalog, orders, 1C integration, authorization modules. We look for injections, caching errors, and skewed architecture.
  3. Query profiling — enable BX_DEBUG on dev. Benchmark: up to 30 SQL per page. More than 100 indicates a systemic problem.
  4. Report — a table with severity classification, code examples, and recommendations.
Sample report excerpt
Category Issues Found Critical
Security 18 3
Performance 24 5
Architecture 31 0
Outdated APIs 67 0

Recommended Audit Frequency

We recommend a code review once a year, when switching contractors, after implementing major features, or before scaling. Regular audits keep technical debt under control and allow timely kernel updates.

What the Service Includes

  • Static analysis (PHPStan + PHPCS) with a violation report
  • Manual check of key subsystems: catalog, orders, integrations, authorization
  • SQL query profiling on your dev server
  • Security audit: SQL injections, XSS, secret storage
  • Final report with severity classification and recommendations
  • Consultation on the refactoring plan

Case Study: A Marketplace on Bitrix

The project had been developed by different teams over 5 years. The current contractor claimed it was impossible to add new functionality “due to crooked architecture.” We conducted a review and identified systemic problems.

What we found: 847 direct $DB->Query() calls with concatenation — 12 potential SQL injections? N+1 in listings: 1 query for the list + N for prices (with N=50, 51 queries instead of 2). Business logic in template.php of components. 40% of custom code in /bitrix/. The client’s savings from eliminating critical vulnerabilities exceeded a significant amount, and a 3x reduction in server load cut infrastructure costs.

“After the review we were able to update the kernel without panic, and load dropped by a factor of three,” — client CTO.

Result: a prioritized refactoring plan for 6 months. Critical vulnerabilities fixed in 2 weeks. From our practice, this case saved the client about 2 months of development and reduced server load by 3x. 95% of clients extend their contract after the first review.

How to Order a Code Audit?

If you’ve noticed slowdown symptoms or want to check your project’s security — request a code audit. We’ll prepare a detailed report and recommendations. Contact us to discuss scope and timeline. Get a free consultation.

Bitrix Site Audit: Find Problems Before They Find You

Imagine: you open a project from a previous team — init.php has 3,000 lines, OnBeforeIBlockElementUpdate handlers are nested, there's a 4GB dump.sql in the site root, and the upload/ directory is larger than the database. We see such projects every week. And this is not an exception — it's the norm for Bitrix after several years of active development without quality control. An audit of a 1C-Bitrix site is the only way to objectively assess the real state of a project before investing in improvements or scaling. It reveals bottlenecks in code, database, server configuration, and security. Most importantly, it shows what to fix to make the site faster and prevent crashes during peak sales. Regular 1C-Bitrix site audit pays off in 2–3 months: hosting savings are substantial, and error fix time is cut by three times compared to a reactive approach.

Why is a Bitrix site audit necessary?

Changing contractors — you take over a project from another team and don't know what "mines" are left in the code. Event handlers in init.php, forgotten scripts, modified kernel files — all can backfire at the worst moment. We once found 47 handlers in one project, 12 of which were dead — information blocks were deleted, but the code kept calling CIBlockElement::GetList() on every hit. For several years of such load — millions of extra queries to the database.

Position drop — technical reasons almost always underlie organic traffic loss: page duplicates, broken canonical, 50,000 junk URLs in the index. An audit will show where Google is losing your traffic. In one typical project, the number of URLs with sorting parameters reached 300,000 — each combination of PAGEN_1=2&sort=price was indexed separately.

Slowness under load — the site goes down right during a sale, when every minute of downtime costs money. We find the reasons: unoptimized queries, lack of cache, heavy agents. For example, one query to b_iblock_element_property without an index can add 3–4 seconds to page generation time.

Suspicion of hacking — spam emails from the server, redirects to casino on mobile traffic, strange files in /bitrix/modules/. A security audit will reveal backdoors and web shells.

Before major improvements — investing in project development without knowing its real state is like building a second floor without checking the foundation. Half of our clients come precisely before starting new functionality.

What hides in init.php and the database?

Most problems on Bitrix are concentrated in three places: init.php, the database, and server configuration. We break down each layer in detail.

init.php and event handlers — the main code dump. There accumulate OnAfterUserLogin, OnBeforeOrderAdd, OnAdminContextMenuShow that no one refactors for years. In one project we found 47 handlers, 12 of which were dead (information blocks deleted, but the code kept calling CIBlockElement::GetList() on every hit). An audit clears out such ballast and reduces server load.

Versions and compatibility. Kernel version — if below 22.0, update is critical (PHP 8.1 not supported). Marketplace modules often conflict after updates. License without an active key — no security updates.

Server configuration. PHP memory_limit < 256M — problems with catalogs of 10,000+ items. OPcache revalidate_freq = 0 in production — CPU overloaded. MySQL innodb_buffer_pool_size should be 70–80% of RAM. On MySQL 8.0+ query_cache is removed, but it remains in old configs — generating errors in logs. Absence of expires for static files in nginx — each page reload downloads JS/CSS again.

Database — the most interesting part. The b_event_log table grows to gigabytes without cleanup settings. In one project it occupied 12 GB, though 500,000 records were written daily. The b_search_content_text table with a full-text index can weigh more than the content itself. Tables from deleted modules (b_forum_*, b_learning_*) take up space and slow down backups. We enable slow query log, wait a day, analyze. One query to b_iblock_element_property without an index can slow the entire site — we recorded delays up to 7 seconds per page.

File system. /upload/resize_cache/ — weighs tens of gigabytes, stores resizes of long-deleted images. Backups in the root — backup_old.tar.gz next to index.php, accessible via direct link. Manually modified kernel files will be overwritten during update, and custom logic will silently disappear.

How does SEO audit remove duplicates and trash from the index?

Filter and sort parameters generate thousands of URLs: /catalog/?PAGEN_1=2, /catalog/?sort=price&order=asc — each indexed as a separate page. Bitrix SEO module can set canonical, but by default it doesn't do it for parameterized URLs. The standard robots.txt blocks /bitrix/, but doesn't block /search/, /personal/, /ajax/ — there are thousands more junk pages. Bitrix's sitemap.xml generator sometimes includes inactive items and 404 pages. Without structured data Schema.org (Product, BreadcrumbList, Organization), snippets in search results are bland. Core Web Vitals: LCP > 2.5s on mobile is common for unoptimized Bitrix — unoptimized images and blocking JS are to blame. On average, after an audit we reduce the index by 60–80% — remove duplicates, set up canonical and proper noindex. Order an SEO audit to get your site the traffic it's losing now.

Why check Bitrix security?

SQL injections via $_REQUEST in custom components — previous developers don't always use $DB->ForSql(). XSS when outputting user input without htmlspecialcharsbx(). Custom file upload forms that don't check MIME type and extension — upload .php as an "image" and get a web shell. Typical findings: disabled "Proactive Protection" module (WAF not working, intrusion log empty), admin panel without IP restriction (/bitrix/admin/ open to the world), adminer.php or phpMyAdmin in the root — forgotten after migration, obfuscated code in .htaccess with mobile traffic redirect via RewriteCond %{HTTP_USER_AGENT}, modified kernel files with eval(base64_decode(...)) inserts. In one project we found 23 such files — the site had been distributing spam content via AMP for months. Read more about SQL injection and cross-site scripting. Contact us for a security check of your project — we will find vulnerabilities that scanners miss.

How do we improve performance?

We profile using Blackfire or Tideways — see which functions consume CPU. A frequent candidate is CIBlockElement::GetList() in a loop (classic N+1). We check hit rate of OPcache, Memcached, Bitrix managed cache. If composite site cache invalidates on every order, it's useless — we once reduced invalidations from 80% to 2% by proper tag configuration. Bitrix agents — if agents_use_crontab is not enabled, they execute on user hits; a heavy agent = slow for random visitor. Load testing: base RPS, degradation at 2× and 5× load, behavior when limit exceeded (graceful degradation or 502 Bad Gateway?). On one project we found peak RPS was 12, and after optimization became 150 — a 12.5x increase.

What do we look for in code?

We assess custom developments of previous teams: do they use D7 ORM or just $DB->Query() bypassing everything. PSR-12, autoloading, module structure — or everything in one file. N+1 — GetList() inside while($arItem = $rsItems->Fetch()) — classic. Modified kernel files (bitrix/modules/sale/lib/) with manual edits — updates will break everything. "Temporary" solutions living for three years — // TODO: redo from last year. On average, we find 15–25 problems in code per project, half of them with potential data loss.

Report format

Category Contents
Critical Security, data loss, crashes. Fix today
Important Performance, SEO, stability
Recommendations Architectural improvements, refactoring, optimizations
Plan Prioritized task list with effort estimates

Each problem is described by scheme: what we found → where → how it affects → how to fix → effort. We deliver the report in PDF and Google Docs for collaboration. Five signs that a Bitrix site needs an audit: init.php has grown over 2,000 lines; database exceeds 5 GB, and b_event_log table over 1 GB; pages load longer than 3 seconds on mobile; Search Console shows tens of thousands of pages in index with errors; you found files with suspicious content in /bitrix/modules/. If at least one point matches — time to order an audit.

How do we conduct an audit?

  1. Access — Bitrix panel, SSH, database, Yandex.Webmaster, Search Console.
  2. Automation — Bitrix "Quality Monitor", Screaming Frog, GTmetrix, security scanners. Catch 60% of problems.
  3. Manual analysis — the remaining 40%. Architecture, code, business logic, configuration — only hands-on. Each audit is led by a senior developer with 10+ years of experience.
  4. Report with priorities.
  5. Discussion — meeting with you, answering questions, agreeing on a remediation plan.

Average time for a full cycle — 5 business days for technical audit, up to 3 weeks for comprehensive. We guarantee confidentiality of results and safety of your data.

What is included in deliverables?

  • Documented report with description of each problem and fix recommendations.
  • Checklist of critical vulnerabilities and their priority.
  • List of performance optimization suggestions with impact assessment.
  • Post-audit consultation — review of results, task prioritization.
  • Access to test results (screenshots, profiling logs, raw data).

Types of audit and timelines

Type Timeline For whom
Express (checklist) 2–3 days Quick assessment, small sites
Technical 3–5 days Identifying infrastructure issues
SEO 3–5 days Position drop, trash in index
Security 5–7 days Sites with payments, personal data
Performance 3–5 days Slow, crashes under load
Comprehensive 2–3 weeks Full picture before serious investments

We have conducted 50+ audits of Bitrix projects — from online stores to corporate portals. Our experience shows: on average, an audit pays off within 2–3 months by reducing hosting costs and cutting error fix time (3 times faster than reactive approach). Regular audit is the best way to extend project life.

Result — not a stack of papers, but a guide to action with concrete tasks and priorities. Need an audit of your Bitrix site? Get a consultation today — contact us, and we will assess your project for free within 1 business day. Order a comprehensive audit to get the full picture before serious investments.