PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 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 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager-impl.php +16 -17 13.0.2 → 16.3 View file →
@@ -8,9 +8,9 @@
8 8 // After changing this file, consider increasing the version number ("VXXX") in all the files using this namespace, in
9 9 // order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
10 10 // to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
11 11 // are installed, or in some other cases).
12 -namespace Automattic\Jetpack\Backup\V0001;
12 +namespace Automattic\Jetpack\Backup\V0005;
13 13
14 14 use Exception;
15 15 use WP_Error;
16 16 use function content_url;
@@ -122,13 +122,25 @@
122 122 $abspath_url = get_site_url();
123 123
124 124 $locations = array();
125 125
126 - // Prioritize trying to write to "wp-content/" and "wp-content/uploads/" first, because those locations are
127 - // expected to be writable more often (unlike ABSPATH), and ABSPATH on some setups might have a weird value
128 - // which doesn't point to document root.
126 + // Prioritize ABSPATH first, because even though ABSPATH constant's value might be weird sometimes, it's the
127 + // path where the PHP scripts will be most likely be able to get executed.
129 128
130 129 try {
130 + if ( Throw_On_Errors::t_is_dir( ABSPATH ) ) {
131 + $abspath_dir = Throw_On_Errors::t_realpath( ABSPATH );
132 + $locations[ $abspath_dir ] = $abspath_url;
133 + }
134 + } catch ( Exception $exception ) {
135 + $locations[ ABSPATH ] = new WP_Error(
136 + 'abspath_missing',
137 + 'Unable to access WordPress root "' . ABSPATH . '": ' . $exception->getMessage(),
138 + array( 'status' => 500 )
139 + );
140 + }
141 +
142 + try {
131 143 if ( Throw_On_Errors::t_is_dir( WP_CONTENT_DIR ) ) {
132 144 $wp_content_dir = Throw_On_Errors::t_realpath( WP_CONTENT_DIR );
133 145
134 146 // Using content_url() instead of WP_CONTENT_URL as it tests for whether we're using SSL.
@@ -175,21 +187,8 @@
175 187 } catch ( Exception $exception ) {
176 188 $locations[ $wp_uploads_dir ] = new WP_Error(
177 189 'uploads_path_missing',
178 190 'Unable to access uploads path "' . $wp_uploads_dir . '"' . $exception->getMessage(),
179 - array( 'status' => 500 )
180 - );
181 - }
182 -
183 - try {
184 - if ( Throw_On_Errors::t_is_dir( ABSPATH ) ) {
185 - $abspath_dir = Throw_On_Errors::t_realpath( ABSPATH );
186 - $locations[ $abspath_dir ] = $abspath_url;
187 - }
188 - } catch ( Exception $exception ) {
189 - $locations[ ABSPATH ] = new WP_Error(
190 - 'abspath_missing',
191 - 'Unable to access WordPress root "' . ABSPATH . '": ' . $exception->getMessage(),
192 191 array( 'status' => 500 )
193 192 );
194 193 }
195 194