Making WordPress.org


Ignore:
Timestamp:
02/21/2018 12:10:49 AM (6 years ago)
Author:
iandunn
Message:

WordCamp Remote CSS: Apply coding standards.

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  
    66use Exception;
    77
    8 defined( 'WPINC' ) or die();
     8defined( 'WPINC' ) || die();
    99
    1010/**
     
    2929 * @param string $remote_css_url
    3030 *
    31  * @throws \Exception if the response body could not be retrieved for any reason
     31 * @throws Exception If the response body could not be retrieved for any reason.
    3232 *
    3333 * @return string
     
    3737        $remote_css_url,
    3838        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.
    4040            'reject_unsafe_urls' => true,
    4141        )
     
    4444    if ( is_wp_error( $response ) ) {
    4545        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() );
    4747    }
    4848
     
    5252        Logger\log( 'invalid_response_code', compact( 'remote_css_url', 'response' ) );
    5353
    54         throw new \Exception( sprintf(
     54        throw new Exception( sprintf(
    5555            __( 'The remote server responded with status code <code>%d</code>, which is not valid.', 'wordcamporg' ),
    5656            $response_code
     
    8484    if ( ! $parser_rules_setup || ! $subvalue_sanitization_setup ) {
    8585        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' ),
    8888            EMAIL_CENTRAL_SUPPORT
    8989        ) );
     
    9898    if ( did_action( 'csstidy_optimize_postparse' ) < 1 ) {
    9999        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' ),
    102102            EMAIL_CENTRAL_SUPPORT
    103103        ) );
     
    113113 */
    114114function save_safe_css( $safe_css ) {
    115     $post = get_safe_css_post();
     115    $post               = get_safe_css_post();
    116116    $post->post_content = $safe_css;
    117117
Note: See TracChangeset for help on using the changeset viewer.