Skip to content

Commit

Permalink
Merge pull request #30 from BeycanPress/alpha
Browse files Browse the repository at this point in the history
Alpha
  • Loading branch information
BeycanDeveloper authored Oct 1, 2024
2 parents 8a803f8 + 815f8dd commit ba211b9
Show file tree
Hide file tree
Showing 52 changed files with 1,012 additions and 898 deletions.
3 changes: 1 addition & 2 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ composer.lock
phpcs.xml
gulpfile.mjs
package.json
package-lock.json
/src/
package-lock.json
45 changes: 1 addition & 44 deletions app/PluginHero/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@ public static function getPHPVersion(): float
return floatval($version[0] . '.' . $version[1]);
}

/**
* Hi, this is a helper function to get the ionCube version.
* But we not use it in the wp.org plugins.
* Only in premium versions for protect license.
* @return int|null
*/
public static function getIoncubeVersion(): ?int
{
if (function_exists('ioncube_loader_iversion')) {
$version = ioncube_loader_iversion();
$version = sprintf('%d', $version / 10000);
return intval($version);
}
return null;
}

/**
* @param array<mixed> $rules
* @param string $pluginFile
Expand All @@ -94,41 +78,14 @@ public static function createRequirementRules(array $rules, string $pluginFile):
if ($condition) {
$status = false;
add_action('admin_notices', function () use ($phpVersions, $pluginName): void {
$versions = is_array($phpVersions) ? implode(', ', $phpVersions) : $phpVersions . ' or higher';
$versions = is_array($phpVersions) ? implode(', ', $phpVersions) : ($phpVersions . ' or higher');
// @phpcs:ignore
$message = $pluginName . ': Your current PHP version does not support ' . self::getPHPVersion() . '. This means errors may occur due to incompatibility or other reasons. So ' . $pluginName . ' is disabled please use one of the supported versions ' . $versions . '. You can ask your server service provider to update your PHP version.';
printf('<div class="notice notice-error"><p>%1$s</p></div>', esc_html($message));
});
}
}

if (isset($rules['ioncubeVersion'])) {
$ionCubeVersion = self::getIoncubeVersion();
$requiredIonCubeVersion = $rules['ioncubeVersion'];
if (!is_int($requiredIonCubeVersion)) {
throw new \Exception('ioncubeVersion must be an integer!');
}
if (!$ionCubeVersion || $ionCubeVersion < $requiredIonCubeVersion) {
$status = false;
// @phpcs:ignore
add_action('admin_notices', function () use ($requiredIonCubeVersion, $ionCubeVersion, $pluginName): void {
$message = $pluginName . ": Is disabled because " . ('cli' == php_sapi_name() ? 'ionCube ' . $requiredIonCubeVersion : '<a href="http://www.ioncube.com">ionCube ' . $requiredIonCubeVersion . '</a>') . " PHP Loader is not installed! In order for " . $pluginName . " to work, you must have ionCube " . $requiredIonCubeVersion . " and above. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking. Please visit " . ('cli' == php_sapi_name() ? 'ioncube.com/loaders.php' : '<a href="https://www.ioncube.com/loaders.php">ioncube.com/loaders.php</a>') . " for install assistance or you can ask your server service provider to install ionCube " . $requiredIonCubeVersion . " or above. Your current installed IonCube version is " . ($ionCubeVersion ? $ionCubeVersion : 'not installed') . "."; // @phpcs:ignore
printf('<div class="notice notice-error"><p>%1$s</p></div>', wp_kses_post($message));
});
}
if (extension_loaded('xdebug') && $status) {
$modes = xdebug_info('mode');
$loaderFile = file_get_contents(dirname(__DIR__) . '/Loader.php', true);
if (isset($modes[0]) && 'off' != $modes[0] && false !== strpos($loaderFile, 'HR+')) {
$status = false;
add_action('admin_notices', function () use ($pluginName): void {
$message = $pluginName . ': xDebug installation was detected and ' . $pluginName . ' was disabled because of it. This is because ' . $pluginName . ' uses IonCube for license protection and the IonCube Loader is incompatible with xDebug, causing the site to crash. xDebug helps developers with debug and profile, but it doesn\'t need to be on the production site. So to turn off xDebug, please set mode to off or uninstall it. If you are not familiar with this process, you can get help from your server service provider.'; // @phpcs:ignore
printf('<div class="notice notice-error"><p>%1$s</p></div>', esc_html($message));
});
}
}
}

if (isset($rules['extensions'])) {
$extensions = $rules['extensions'];
if (!is_array($extensions)) {
Expand Down
28 changes: 14 additions & 14 deletions assets/js/app.min.js

Large diffs are not rendered by default.

1,098 changes: 549 additions & 549 deletions assets/js/evm-chains-provider.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/evm-chains-provider.js.map

Large diffs are not rendered by default.

29 changes: 1 addition & 28 deletions assets/js/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/main.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"ext-bcmath": "*",
"beycanpress/csf": "^2.3",
"multiplechain/evm-chains": "^0.1.23",
"multiplechain/evm-chains": "^0.1.24",
"beycanpress/currency-converter": "^0.1.3"
}
}
Loading

0 comments on commit ba211b9

Please sign in to comment.