-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move amp-beta-tester.php to root folder
- Loading branch information
Showing
6 changed files
with
68 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Plugin Name: AMP Beta Tester | ||
* Description: Opt-in to receive non-stable release builds for the AMP plugin. | ||
* Plugin URI: https://amp-wp.org | ||
* Author: AMP Project Contributors | ||
* Author URI: https://github.com/ampproject/amp-wp/graphs/contributors | ||
* Version: 0.1 | ||
* Text Domain: amp-beta-tester | ||
* Domain Path: /languages/ | ||
* License: GPLv2 or later | ||
* | ||
* @package AMP Beta Tester | ||
*/ | ||
|
||
namespace AMP_Beta_Tester; | ||
|
||
define( 'AMP__BETA_TESTER__DIR__', dirname( __FILE__ ) ); | ||
|
||
add_action( 'plugins_loaded', __NAMESPACE__ . '\init' ); | ||
|
||
/** | ||
* Hook into WP. | ||
* | ||
* @return void | ||
*/ | ||
function init() { | ||
// Abort init if AMP plugin is not available. | ||
if ( ! defined( 'AMP__FILE__' ) ) { | ||
add_action( 'admin_notices', __NAMESPACE__ . '\show_missing_amp_notice' ); | ||
return; | ||
} | ||
} | ||
|
||
/** | ||
* Display an admin notice if the AMP plugin is not detected. | ||
* | ||
* @return void | ||
*/ | ||
function show_missing_amp_notice() { | ||
$error = sprintf( | ||
// translators: %s: AMP plugin URL. | ||
esc_html__( | ||
'AMP Beta Tester requires AMP to be installed and active. You can download AMP %s.', | ||
'amp-beta-tester' | ||
), | ||
'<a href="https://amp-wp.org" target="_blank">here</a>' | ||
); | ||
|
||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | ||
echo "<div class='notice notice-error'><p><strong>{$error}</strong></p></div>"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.