PluginProbe
AMP WP – Google AMP For WordPress / 1.8.0
AMP WP – Google AMP For WordPress v1.8.0
1.8.3 1.8.2 1.8.1 1.8.0 1.7.11 1.7.10 1.7.9 1.7.7 1.7.8 1.7.6 1.7.5 1.7.4 1.7.3 1.7.2 1.7.1 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.3.1 All 56 releases
amp-wp / amp-wp.php

amp-wp.php in AMP WP – Google AMP For WordPress 1.8.0, at amp-wp.php

115 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The plugin bootstrap file
4 *
5 * This file is read by WordPress to generate the plugin information in the plugin
6 * admin area. This file also includes all of the dependencies used by the plugin,
7 * registers the activation and deactivation functions, and defines a function
8 * that starts the plugin.
9 *
10 * @link https://mohsinrafique.com
11 * @since 1.0.0
12 * @package Amp_WP
13 *
14 * @wordpress-plugin
15 * Plugin Name: AMP WP
16 * Plugin URI: https://wordpress.org/plugins/amp-wp
17 * Description: Automagically add Google AMP functionality to your site. Tons of Premium Features for FREE. Enable/Disable Post Types, Categories, and Tags.
18 * Version: 1.8.0
19 * Author: Mohsin Rafique, Pixelative
20 * Author URI: https://mohsinrafique.com
21 * License: GPL-2.0+
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23 * Text Domain: amp-wp
24 * Domain Path: /languages
25 */
26
27 // If this file is called directly, abort.
28 if ( ! defined( 'WPINC' ) ) {
29 die;
30 }
31
32 define( 'AMP_WP_DEV_MODE', false );
33 define( 'AMP_WP_TEMPLATE_DIR', plugin_dir_path( __FILE__ ) . 'public/partials/' );
34 define( 'AMP_WP_TEMPLATE_DIR_CSS', '../../css/' );
35 define( 'AMP_WP_DIR_PATH', plugin_dir_path( __FILE__ ) );
36 define( 'AMP_WP_DIR_URL', plugin_dir_url( __FILE__ ) );
37 define( 'AMP_WP_AJAX_URL', esc_js( admin_url( 'admin-ajax.php' ) ) );
38
39 define( 'AMP_WP_OVERRIDE_TPL_DIR', 'amp-wp' );
40 define( 'AMP_WP_SLOGAN', 'Google AMP For WordPress' );
41
42 $amp_wp_general_settings = get_option( 'amp_wp_general_settings', array() );
43 $theme_name = ( isset( $amp_wp_general_settings['theme_name'] ) && ! empty( $amp_wp_general_settings['theme_name'] ) ) ? esc_attr( $amp_wp_general_settings['theme_name'] ) : 'tez';
44
45 if ( $theme_name ) {
46 define( 'AMP_WP_THEME_NAME', $theme_name );
47 } else {
48 define( 'AMP_WP_THEME_NAME', 'tez' );
49 }
50
51 /**
52 * Currently plugin version.
53 * Start at version 1.0.0 and use SemVer - https://semver.org
54 * Rename this for your plugin and update it as you release new versions.
55 */
56 define( 'AMP_WP_VERSION', '1.8.0' );
57
58 /**
59 * Display Plugin Upgrade Notice to Users
60 *
61 * @since 1.0.3
62 * @param array $data An array of plugin metadata.
63 * @param array $response An array of metadata about the available plugin update.
64 */
65 function amp_wp_plugin_update_message( $data, $response ) {
66 if ( isset( $data['upgrade_notice'] ) && strlen( trim( $data['upgrade_notice'] ) ) > 0 ) {
67 printf( '<div class="amp-wp-update-message">%s</div>', wp_kses_post( wpautop( $data['upgrade_notice'] ) ) );
68 }
69 }
70
71 // Hook to display a message in the plugins list.
72 add_action( 'in_plugin_update_message-amp-wp/amp-wp.php', 'amp_wp_plugin_update_message', 10, 2 );
73
74 /**
75 * The code that runs during plugin activation.
76 * This action is documented in includes/class-amp-wp-activator.php
77 */
78 function activate_amp_wp() {
79 require_once plugin_dir_path( __FILE__ ) . 'includes/class-amp-wp-activator.php';
80 Amp_WP_Activator::activate();
81 }
82
83 /**
84 * The code that runs during plugin deactivation.
85 * This action is documented in includes/class-amp-wp-deactivator.php
86 */
87 function deactivate_amp_wp() {
88 require_once plugin_dir_path( __FILE__ ) . 'includes/class-amp-wp-deactivator.php';
89 Amp_WP_Deactivator::deactivate();
90 }
91
92 register_activation_hook( __FILE__, 'activate_amp_wp' );
93 register_deactivation_hook( __FILE__, 'deactivate_amp_wp' );
94
95 /**
96 * The core plugin class that is used to define internationalization,
97 * admin-specific hooks, and public-facing site hooks.
98 */
99 require plugin_dir_path( __FILE__ ) . 'includes/class-amp-wp.php';
100
101 /**
102 * Begins execution of the plugin.
103 *
104 * Since everything within the plugin is registered via hooks,
105 * then kicking off the plugin from this point in the file does
106 * not affect the page life cycle.
107 *
108 * @since 1.0.0
109 */
110 function run_amp_wp() {
111 $plugin = new Amp_WP();
112 $plugin->run();
113 }
114 run_amp_wp();
115