PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/Fallback/FallBack.php +12 -7 2.02.15.3 View file →
@@ -3,10 +3,12 @@
3 3 namespace BitCode\BitForm\Core\Fallback;
4 4
5 5 use ReflectionMethod;
6 6
7 -final class FallBack {
8 - public static function getOlderVersion() {
7 +final class FallBack
8 +{
9 + public static function getOlderVersion()
10 + {
9 11 $installed = get_option('bitforms_installed');
10 12 $oldversion = null;
11 13 if ($installed) {
12 14 $oldversion = get_option('bitforms_version');
@@ -13,9 +15,10 @@
13 15 }
14 16 return $oldversion;
15 17 }
16 18
17 - public static function add($version, $invokeable, $check = '>=') {
19 + public static function add($version, $invokeable, $check = '>=')
20 + {
18 21 $oldversion = self::getOlderVersion();
19 22 if ($oldversion && version_compare($oldversion, BITFORMS_VERSION, '!=')) {
20 23 return static::action($version, $invokeable, $oldversion, $check);
21 24 }
@@ -20,9 +23,13 @@
20 23 return static::action($version, $invokeable, $oldversion, $check);
21 24 }
22 25 }
23 26
24 - public static function action($version, $invokeable, $oldversion, $check) {
27 + public static function action($version, $invokeable, $oldversion, $check)
28 + {
29 + if (!version_compare($version, $oldversion, $check)) {
30 + return false;
31 + }
25 32 $namespace = 'BitCode\BitForm\Core\Fallback';
26 33 $invoke = explode('@', $invokeable);
27 34 if (is_array($invoke) && 2 === count($invoke)) {
28 35 $fileName = $invoke[0];
@@ -29,11 +36,9 @@
29 36 $method = $invoke[1];
30 37 $class = $namespace . '\\' . $fileName;
31 38 if (class_exists($class) && method_exists($class, $method)) {
32 39 $invokeMethod = new ReflectionMethod($class, $method);
33 - if (version_compare($version, $oldversion, $check)) {
34 - $invokeMethod->invoke($invokeMethod->isStatic() ? null : new $class());
35 - }
40 + $invokeMethod->invoke($invokeMethod->isStatic() ? null : new $class());
36 41 } else {
37 42 return 'Method or class not exist';
38 43 }
39 44 } else {