| @@ -38,9 +38,11 @@ | ||
| 38 | 38 | |
| 39 | 39 | return false; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return require $autoloader; | |
| 42 | + require_once $autoloader; | |
| 43 | + | |
| 44 | + return true; | |
| 43 | 45 | } |
| 44 | 46 | |
| 45 | 47 | /** |
| 46 | 48 | * If the autoloader is missing, add an admin notice. |
| @@ -45,18 +47,24 @@ | ||
| 45 | 47 | /** |
| 46 | 48 | * If the autoloader is missing, add an admin notice. |
| 47 | 49 | * |
| 48 | 50 | * @param string $plugin_name Plugin name for error messaging. |
| 51 | + * | |
| 52 | + * @return void | |
| 49 | 53 | */ |
| 50 | 54 | protected static function missing_autoloader( $plugin_name = '' ) { |
| 51 | 55 | /* translators: 1. Plugin name */ |
| 52 | - $message = sprintf( esc_html__( 'Your installation of %1$s is incomplete. If you installed %1$s from GitHub, please refer to this document to set up your development environment.', 'content-control' ), $plugin_name ); | |
| 56 | + $text = __( 'Your installation of %1$s is incomplete. If you installed %1$s from GitHub, please refer to this document to set up your development environment.', 'content-control' ); | |
| 53 | 57 | |
| 58 | + $message = sprintf( $text, $plugin_name ); | |
| 59 | + | |
| 54 | 60 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
| 55 | - error_log( // phpcs:ignore | |
| 56 | - $message | |
| 61 | + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log | |
| 62 | + error_log( | |
| 63 | + esc_html( $message ) | |
| 57 | 64 | ); |
| 58 | 65 | } |
| 66 | + | |
| 59 | 67 | add_action( |
| 60 | 68 | 'admin_notices', |
| 61 | 69 | function () use ( $message ) { |
| 62 | 70 | ?> |