Use plugins instead of included files.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #2885001. -->
Reported by: [voleger](https://www.drupal.org/user/3260314)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Limited extending of list of variables. Use include files for that is not a solution.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Move variables definitions into GlobalVariable plugins.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>New posibility define variables using Global Variable plugin.</p>
<h3 id="summary-original-report">Original report by voleger</h3>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br></span><span style="color: #FF8000">// Social Sharing<br> </span><span style="color: #007700">include </span><span style="color: #DD0000">'includes/social-sharing.php'</span><span style="color: #007700">;<br></span><span style="color: #0000BB">?></span></span></pre></div>
<p>This is not the Drupal way.<br>
The easiest way to move functionality out of hook_preprocess is to use Services.</p>
issue