PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
← All changes | jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php +23 -6 13.3.3 → 16.3-beta View file →
@@ -8,8 +8,12 @@
8 8 namespace Automattic\Jetpack\Sync\Modules;
9 9
10 10 use Automattic\Jetpack\Sync\Defaults;
11 11
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit( 0 );
14 +}
15 +
12 16 /**
13 17 * Class to handle sync for constants.
14 18 */
15 19 class Constants extends Module {
@@ -27,8 +31,15 @@
27 31 */
28 32 const CONSTANTS_AWAIT_TRANSIENT_NAME = 'jetpack_sync_constants_await';
29 33
30 34 /**
35 + * Constants whitelist array.
36 + *
37 + * @var array
38 + */
39 + public $constants_whitelist;
40 +
41 + /**
31 42 * Sync module name.
32 43 *
33 44 * @access public
34 45 *
@@ -138,19 +149,25 @@
138 149 *
139 150 * @access public
140 151 *
141 152 * @param array $config Full sync configuration for this sync module.
153 + * @param array $status This module Full Sync status.
142 154 * @param int $send_until The timestamp until the current request can send.
143 - * @param array $state This module Full Sync status.
155 + * @param int $started The timestamp when the full sync started.
144 156 *
145 157 * @return array This module Full Sync status.
146 158 */
147 - public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
159 + public function send_full_sync_actions( $config, $status, $send_until, $started ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
148 160 // we call this instead of do_action when sending immediately.
149 - $this->send_action( 'jetpack_full_sync_constants', array( true ) );
161 + $result = $this->send_action( 'jetpack_full_sync_constants', array( true ) );
150 162
151 - // The number of actions enqueued, and next module state (true == done).
152 - return array( 'finished' => true );
163 + if ( is_wp_error( $result ) ) {
164 + $status['error'] = true;
165 + return $status;
166 + }
167 + $status['finished'] = true;
168 + $status['sent'] = $status['total'];
169 + return $status;
153 170 }
154 171
155 172 /**
156 173 * Retrieve an estimated number of actions that will be enqueued.
@@ -158,9 +175,9 @@
158 175 * @access public
159 176 *
160 177 * @param array $config Full sync configuration for this sync module.
161 178 *
162 - * @return array Number of items yet to be enqueued.
179 + * @return int Number of items yet to be enqueued.
163 180 */
164 181 public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
165 182 return 1;
166 183 }