ManageWP Worker - Version 4.9.11

Version Description

  • Fix: Ensure full compatibility with PHP 8.1
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 ManageWP Worker
Version 4.9.11
Comparing to
See all releases

Code changes from version 4.9.10 to 4.9.11

Files changed (4) hide show
  1. init.php +3 -3
  2. readme.txt +4 -1
  3. src/MWP/WordPress/Context.php +26 -15
  4. version +2 -2
init.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: ManageWP - Worker
4
  Plugin URI: https://managewp.com
5
  Description: We help you efficiently manage all your WordPress websites. <strong>Updates, backups, 1-click login, migrations, security</strong> and more, on one dashboard. This service comes in two versions: standalone <a href="https://managewp.com">ManageWP</a> service that focuses on website management, and <a href="https://godaddy.com/pro">GoDaddy Pro</a> that includes additional tools for hosting, client management, lead generation, and more.
6
- Version: 4.9.10
7
  Author: GoDaddy
8
  Author URI: https://godaddy.com
9
  License: GPL2
@@ -568,8 +568,8 @@ if (!function_exists('mwp_init')):
568
  // reason (eg. the site can't ping itself). Handle that case early.
569
  register_activation_hook(__FILE__, 'mwp_activation_hook');
570
 
571
- $GLOBALS['MMB_WORKER_VERSION'] = '4.9.10';
572
- $GLOBALS['MMB_WORKER_REVISION'] = '2021-09-08 00:00:00';
573
 
574
  // Ensure PHP version compatibility.
575
  if (version_compare(PHP_VERSION, '5.2', '<')) {
3
  Plugin Name: ManageWP - Worker
4
  Plugin URI: https://managewp.com
5
  Description: We help you efficiently manage all your WordPress websites. <strong>Updates, backups, 1-click login, migrations, security</strong> and more, on one dashboard. This service comes in two versions: standalone <a href="https://managewp.com">ManageWP</a> service that focuses on website management, and <a href="https://godaddy.com/pro">GoDaddy Pro</a> that includes additional tools for hosting, client management, lead generation, and more.
6
+ Version: 4.9.11
7
  Author: GoDaddy
8
  Author URI: https://godaddy.com
9
  License: GPL2
568
  // reason (eg. the site can't ping itself). Handle that case early.
569
  register_activation_hook(__FILE__, 'mwp_activation_hook');
570
 
571
+ $GLOBALS['MMB_WORKER_VERSION'] = '4.9.11';
572
+ $GLOBALS['MMB_WORKER_REVISION'] = '2021-12-15 00:00:00';
573
 
574
  // Ensure PHP version compatibility.
575
  if (version_compare(PHP_VERSION, '5.2', '<')) {
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: managewp,freediver
3
  Tags: manage multiple sites, backup, security, migrate, performance, analytics, Manage WordPress, Managed WordPress, WordPress management, WordPress manager, WordPress management, site management, control multiple sites, WordPress management dashboard, administration, automate, automatic, comments, clone, dashboard, duplicate, google analytics, login, manage, managewp, multiple, multisite, remote, seo, spam
4
  Requires at least: 3.1
5
- Tested up to: 5.8
6
  Stable tag: trunk
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/quick-guide-gplv3.html
@@ -55,6 +55,9 @@ Check out the [ManageWP promo video](https://vimeo.com/220647227).
55
  https://vimeo.com/220647227
56
 
57
  == Changelog ==
 
 
 
58
  = 4.9.10 =
59
  - Fix: Resolved compatibility issue with WooCommerce payments
60
  - Fix: Set plugin version for MU plugin loader
2
  Contributors: managewp,freediver
3
  Tags: manage multiple sites, backup, security, migrate, performance, analytics, Manage WordPress, Managed WordPress, WordPress management, WordPress manager, WordPress management, site management, control multiple sites, WordPress management dashboard, administration, automate, automatic, comments, clone, dashboard, duplicate, google analytics, login, manage, managewp, multiple, multisite, remote, seo, spam
4
  Requires at least: 3.1
5
+ Tested up to: 5.8.2
6
  Stable tag: trunk
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/quick-guide-gplv3.html
55
  https://vimeo.com/220647227
56
 
57
  == Changelog ==
58
+ = 4.9.11 =
59
+ - Fix: Ensure full compatibility with PHP 8.1
60
+
61
  = 4.9.10 =
62
  - Fix: Resolved compatibility issue with WooCommerce payments
63
  - Fix: Set plugin version for MU plugin loader
src/MWP/WordPress/Context.php CHANGED
@@ -19,6 +19,8 @@ class MWP_WordPress_Context
19
 
20
  private $constants;
21
 
 
 
22
  /**
23
  * @param array $globals The context to work with. Defaults to $GLOBALS, using the same global variables as WordPress.
24
  * @param array $constants The list of constants to use. Defaults to global constants.
@@ -27,8 +29,9 @@ class MWP_WordPress_Context
27
  {
28
  if ($globals !== null) {
29
  $this->context = $globals;
 
30
  } else {
31
- $this->context = &$GLOBALS;
32
  }
33
 
34
  if ($constants !== null) {
@@ -38,11 +41,19 @@ class MWP_WordPress_Context
38
 
39
  public function set($name, $value)
40
  {
41
- $this->context[$name] = $value;
 
 
 
 
42
  }
43
 
44
  public function get($name)
45
  {
 
 
 
 
46
  return isset($this->context[$name]) ? $this->context[$name] : null;
47
  }
48
 
@@ -51,7 +62,7 @@ class MWP_WordPress_Context
51
  */
52
  public function getDb()
53
  {
54
- return $this->context['wpdb'];
55
  }
56
 
57
  /**
@@ -75,7 +86,7 @@ class MWP_WordPress_Context
75
  */
76
  public function getVersion()
77
  {
78
- return $this->context['wp_version'];
79
  }
80
 
81
  /**
@@ -191,7 +202,7 @@ class MWP_WordPress_Context
191
  */
192
  public function getCurrentBlogId()
193
  {
194
- return abs(intval($this->context['blog_id']));
195
  }
196
 
197
  /**
@@ -290,7 +301,7 @@ class MWP_WordPress_Context
290
  public function getThemes()
291
  {
292
  // When the plugin is MU-loaded, the WordPress theme directories are not set.
293
- if (empty($this->context['wp_theme_directories'])) {
294
  // Register the default theme directory root.
295
  register_theme_directory(get_theme_root());
296
  }
@@ -305,7 +316,7 @@ class MWP_WordPress_Context
305
  public function getCurrentTheme()
306
  {
307
  // When the plugin is MU-loaded, the WordPress theme directories are not set.
308
- if ($this->isMustUse() && empty($this->context['wp_theme_directories'])) {
309
  // Register the default theme directory root.
310
  register_theme_directory(get_theme_root());
311
  }
@@ -356,7 +367,7 @@ class MWP_WordPress_Context
356
 
357
  private function isMustUse()
358
  {
359
- if (empty($this->context['mwp_is_mu'])) {
360
  return false;
361
  }
362
 
@@ -450,7 +461,7 @@ class MWP_WordPress_Context
450
  throw new Exception(sprintf('Context value "%s" does not exist', $name));
451
  }
452
 
453
- return $this->context[$name];
454
  }
455
 
456
  /**
@@ -460,7 +471,7 @@ class MWP_WordPress_Context
460
  */
461
  public function hasContextValue($name)
462
  {
463
- return array_key_exists($name, $this->context);
464
  }
465
 
466
  public function getDropInPlugins()
@@ -590,17 +601,17 @@ class MWP_WordPress_Context
590
 
591
  public function requireWpRewrite()
592
  {
593
- if (isset($this->context['wp_rewrite']) && $this->context['wp_rewrite'] instanceof WP_Rewrite) {
594
  return;
595
  }
596
 
597
  /** @handled class */
598
- $this->context['wp_rewrite'] = new WP_Rewrite();
599
  }
600
 
601
  public function requireTaxonomies()
602
  {
603
- if (!empty($this->context['wp_taxonomies'])) {
604
  return;
605
  }
606
 
@@ -609,7 +620,7 @@ class MWP_WordPress_Context
609
 
610
  public function requirePostTypes()
611
  {
612
- if (!empty($this->context['wp_post_types'])) {
613
  return;
614
  }
615
 
@@ -618,7 +629,7 @@ class MWP_WordPress_Context
618
 
619
  public function requireTheme()
620
  {
621
- if (!empty($this->context['wp_theme_directories'])) {
622
  return;
623
  }
624
 
19
 
20
  private $constants;
21
 
22
+ private $useGlobals;
23
+
24
  /**
25
  * @param array $globals The context to work with. Defaults to $GLOBALS, using the same global variables as WordPress.
26
  * @param array $constants The list of constants to use. Defaults to global constants.
29
  {
30
  if ($globals !== null) {
31
  $this->context = $globals;
32
+ $this->useGlobals = false;
33
  } else {
34
+ $this->useGlobals = true;
35
  }
36
 
37
  if ($constants !== null) {
41
 
42
  public function set($name, $value)
43
  {
44
+ if ($this->useGlobals) {
45
+ $GLOBALS[$name] = $value;
46
+ } else {
47
+ $this->context[$name] = $value;
48
+ }
49
  }
50
 
51
  public function get($name)
52
  {
53
+ if ($this->useGlobals) {
54
+ return isset($GLOBALS[$name]) ? $GLOBALS[$name] : null;
55
+ }
56
+
57
  return isset($this->context[$name]) ? $this->context[$name] : null;
58
  }
59
 
62
  */
63
  public function getDb()
64
  {
65
+ return $this->get('wpdb');
66
  }
67
 
68
  /**
86
  */
87
  public function getVersion()
88
  {
89
+ return $this->get('wp_version');
90
  }
91
 
92
  /**
202
  */
203
  public function getCurrentBlogId()
204
  {
205
+ return abs(intval($this->get('blog_id')));
206
  }
207
 
208
  /**
301
  public function getThemes()
302
  {
303
  // When the plugin is MU-loaded, the WordPress theme directories are not set.
304
+ if (empty($this->get('wp_theme_directories'))) {
305
  // Register the default theme directory root.
306
  register_theme_directory(get_theme_root());
307
  }
316
  public function getCurrentTheme()
317
  {
318
  // When the plugin is MU-loaded, the WordPress theme directories are not set.
319
+ if ($this->isMustUse() && empty($this->get('wp_theme_directories'))) {
320
  // Register the default theme directory root.
321
  register_theme_directory(get_theme_root());
322
  }
367
 
368
  private function isMustUse()
369
  {
370
+ if (empty($this->get('mwp_is_mu'))) {
371
  return false;
372
  }
373
 
461
  throw new Exception(sprintf('Context value "%s" does not exist', $name));
462
  }
463
 
464
+ return $this->useGlobals ? $GLOBALS[$name] : $this->context[$name];
465
  }
466
 
467
  /**
471
  */
472
  public function hasContextValue($name)
473
  {
474
+ return array_key_exists($name, $this->useGlobals ? $GLOBALS : $this->context);
475
  }
476
 
477
  public function getDropInPlugins()
601
 
602
  public function requireWpRewrite()
603
  {
604
+ if ($this->get('wp_rewrite') instanceof WP_Rewrite) {
605
  return;
606
  }
607
 
608
  /** @handled class */
609
+ $this->set('wp_rewrite', new WP_Rewrite());
610
  }
611
 
612
  public function requireTaxonomies()
613
  {
614
+ if (!empty($this->get('wp_taxonomies'))) {
615
  return;
616
  }
617
 
620
 
621
  public function requirePostTypes()
622
  {
623
+ if (!empty($this->get('wp_post_types'))) {
624
  return;
625
  }
626
 
629
 
630
  public function requireTheme()
631
  {
632
+ if (!empty($this->get('wp_theme_directories'))) {
633
  return;
634
  }
635
 
version CHANGED
@@ -1,2 +1,2 @@
1
- 4.9.10
2
- 2021-09-08 00:00:00
1
+ 4.9.11
2
+ 2021-12-15 00:00:00