Changeset 6704 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-remote-css/app/synchronize-remote-css.php
- Timestamp:
- 02/21/2018 12:10:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-remote-css/app/synchronize-remote-css.php
r4596 r6704 6 6 use Exception; 7 7 8 defined( 'WPINC' ) ordie();8 defined( 'WPINC' ) || die(); 9 9 10 10 /** … … 29 29 * @param string $remote_css_url 30 30 * 31 * @throws \Exception if the response body could not be retrieved for any reason31 * @throws Exception If the response body could not be retrieved for any reason. 32 32 * 33 33 * @return string … … 37 37 $remote_css_url, 38 38 array( 39 'user-agent' => 'WordCamp.org Remote CSS', // GitHub's API explicitly requests this, and it could be beneficial for other platforms too 39 'user-agent' => 'WordCamp.org Remote CSS', // GitHub's API explicitly requests this, and it could be beneficial for other platforms too. 40 40 'reject_unsafe_urls' => true, 41 41 ) … … 44 44 if ( is_wp_error( $response ) ) { 45 45 Logger\log( 'request_error', compact( 'remote_css_url', 'response' ) ); 46 throw new \Exception( $response->get_error_message() );46 throw new Exception( $response->get_error_message() ); 47 47 } 48 48 … … 52 52 Logger\log( 'invalid_response_code', compact( 'remote_css_url', 'response' ) ); 53 53 54 throw new \Exception( sprintf(54 throw new Exception( sprintf( 55 55 __( 'The remote server responded with status code <code>%d</code>, which is not valid.', 'wordcamporg' ), 56 56 $response_code … … 84 84 if ( ! $parser_rules_setup || ! $subvalue_sanitization_setup ) { 85 85 throw new Exception( sprintf( 86 // translators: %s is an email address 87 __( "Could not update CSS because sanitization was not available. Please notify us at %s.", 'wordcamporg' ),86 // translators: %s is an email address. 87 __( 'Could not update CSS because sanitization was not available. Please notify us at %s.', 'wordcamporg' ), 88 88 EMAIL_CENTRAL_SUPPORT 89 89 ) ); … … 98 98 if ( did_action( 'csstidy_optimize_postparse' ) < 1 ) { 99 99 throw new Exception( sprintf( 100 // translators: %s is an email address 101 __( "Could not update CSS because sanitization did not run. Please notify us at %s.", 'wordcamporg' ),100 // translators: %s is an email address. 101 __( 'Could not update CSS because sanitization did not run. Please notify us at %s.', 'wordcamporg' ), 102 102 EMAIL_CENTRAL_SUPPORT 103 103 ) ); … … 113 113 */ 114 114 function save_safe_css( $safe_css ) { 115 $post = get_safe_css_post();115 $post = get_safe_css_post(); 116 116 $post->post_content = $safe_css; 117 117
Note: See TracChangeset
for help on using the changeset viewer.