PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.1.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.1.4
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Helpers / global / version.php

version.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.1.4, at back/Helpers/global/version.php

49 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function acym_level($neededLevel)
4 {
5 $levels = [
6 'Starter' => 0,
7 'Essential' => 1,
8 'Enterprise' => 2,
9 ];
10
11 $config = acym_config();
12 $currentLevel = $config->get('level');
13
14 $expirationDate = $config->get('expirationdate', 'not-set');
15
16 if ($config->get('isTrial', 0) == 1 && ($expirationDate !== 'not-set' && $expirationDate < time())) {
17 $currentLevel = 'Starter';
18 }
19
20 $currentLevelNumber = in_array($currentLevel, array_keys($levels)) ? $levels[$currentLevel] : 0;
21
22 return $currentLevelNumber >= $neededLevel;
23 }
24
25 function acym_upgradeTo(string $version, string $utmMedium)
26 {
27 $link = ACYM_ACYMAILING_WEBSITE.'pricing?utm_source=acymailing_plugin&utm_medium='.$utmMedium.'&utm_campaign=purchase';
28 $text = $version === 'essential' ? 'AcyMailing Essential' : 'AcyMailing Enterprise';
29 echo '<div class="acym__upgrade cell grid-x text-center align-center">
30 <h2 class="acym__listing__empty__title cell">'.acym_translationSprintf('ACYM_USE_THIS_FEATURE', '<span class="acym__color__blue">'.$text.'</span>').'</h2>
31 <a target="_blank" href="'.$link.'" class="cell medium-6 large-shrink button acym__button__upgrade">'.acym_translation('ACYM_UPGRADE_NOW_SIMPLE').'</a>
32 </div>';
33 }
34
35 function acym_existsAcyMailing59()
36 {
37 $allTables = acym_getTables();
38 if (!in_array(acym_getPrefix().'acymailing_config', $allTables)) return false;
39
40 $version = acym_loadResult('SELECT `value` FROM #__acymailing_config WHERE `namekey` LIKE "version"');
41
42 return version_compare($version, '5.9.0', '>=');
43 }
44
45 function acym_buttonGetProVersion($class = 'cell shrink', $text = 'ACYM_UPGRADE_NOW_SIMPLE')
46 {
47 return '<a href="'.ACYM_ACYMAILING_WEBSITE.'pricing" target="_blank" class="button acym__button__upgrade '.$class.'">'.acym_translation($text).'</a>';
48 }
49