| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The plugin bootstrap file |
| 5 |
* |
| 6 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 7 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 8 |
* registers the activation and deactivation functions, and defines a function |
| 9 |
* that starts the plugin. |
| 10 |
* |
| 11 |
* @link piwebsolution.com |
| 12 |
* @since 1.10.49 |
| 13 |
* @package Http2_Push_Content |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: HTTP2 push content |
| 17 |
* Description: Push all CSS and JS file through http2 server, plugin add extra files that you want to push like images font files and other |
| 18 |
* Version: 1.10.49 |
| 19 |
* Author: Pi websolution |
| 20 |
* Author URI: piwebsolution.com |
| 21 |
* License: GPL-2.0+ |
| 22 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 23 |
* Text Domain: http2-push-content |
| 24 |
* Domain Path: /languages |
| 25 |
* WC tested up to: 10.9 |
| 26 |
*/ |
| 27 |
|
| 28 |
// If this file is called directly, abort. |
| 29 |
if ( ! defined( 'WPINC' ) ) { |
| 30 |
die; |
| 31 |
} |
| 32 |
|
| 33 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 34 |
|
| 35 |
|
| 36 |
if(is_plugin_active( 'http2-push-content-pro/http2-push-content.php')){ |
| 37 |
|
| 38 |
function pi_http2_free_error_notice() { |
| 39 |
?> |
| 40 |
<div class="error notice"> |
| 41 |
<p><?php _e( 'You have the PRO version of this plugin active, Free version and PRO version cant be active same time', 'http2-push-content'); ?></p> |
| 42 |
</div> |
| 43 |
<?php |
| 44 |
} |
| 45 |
add_action( 'admin_notices', 'pi_http2_free_error_notice' ); |
| 46 |
deactivate_plugins(plugin_basename(__FILE__)); |
| 47 |
return; |
| 48 |
|
| 49 |
}else{ |
| 50 |
/** |
| 51 |
* Currently plugin version. |
| 52 |
* Start at version 1.0.0 and use SemVer - https://semver.org |
| 53 |
* Rename this for your plugin and update it as you release new versions. |
| 54 |
*/ |
| 55 |
|
| 56 |
define( 'HTTP2_PUSH_CONTENT', '1.10.49' ); |
| 57 |
|
| 58 |
define('HTTP2_PUSH_CONTENT_PRICE', '$11'); |
| 59 |
define('HTTP2_PUSH_CONTENT_BUY_URL', 'https://www.piwebsolution.com/cart/?add-to-cart=694&variation_id=1682'); |
| 60 |
|
| 61 |
|
| 62 |
define('PI_HTTP2_MAX_HEADER_SIZE', 1024*8); |
| 63 |
|
| 64 |
/** |
| 65 |
* Declare compatible with HPOS new order table |
| 66 |
*/ |
| 67 |
add_action( 'before_woocommerce_init', function() { |
| 68 |
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 69 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 70 |
} |
| 71 |
} ); |
| 72 |
|
| 73 |
/** |
| 74 |
* The code that runs during plugin activation. |
| 75 |
* This action is documented in includes/class-http2-push-content-activator.php |
| 76 |
*/ |
| 77 |
function activate_http2_push_content() { |
| 78 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-http2-push-content-activator.php'; |
| 79 |
Http2_Push_Content_Activator::activate(); |
| 80 |
} |
| 81 |
|
| 82 |
/** |
| 83 |
* The code that runs during plugin deactivation. |
| 84 |
* This action is documented in includes/class-http2-push-content-deactivator.php |
| 85 |
*/ |
| 86 |
function deactivate_http2_push_content() { |
| 87 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-http2-push-content-deactivator.php'; |
| 88 |
Http2_Push_Content_Deactivator::deactivate(); |
| 89 |
} |
| 90 |
|
| 91 |
register_activation_hook( __FILE__, 'activate_http2_push_content' ); |
| 92 |
register_deactivation_hook( __FILE__, 'deactivate_http2_push_content' ); |
| 93 |
|
| 94 |
/** |
| 95 |
* The core plugin class that is used to define internationalization, |
| 96 |
* admin-specific hooks, and public-facing site hooks. |
| 97 |
*/ |
| 98 |
require plugin_dir_path( __FILE__ ) . 'includes/class-http2-push-content.php'; |
| 99 |
|
| 100 |
if(!function_exists('pisol_http2_plugin_link')){ |
| 101 |
function pisol_http2_plugin_link( $links ) { |
| 102 |
$links = array_merge( array( |
| 103 |
'<a href="' . esc_url( admin_url( '/admin.php?page=http2-push-content' ) ) . '">' . __( 'Settings', 'http2-push-content' ) . '</a>', |
| 104 |
'<a style="color:#0a9a3e; font-weight:bold;" target="_blank" href="https://wordpress.org/support/plugin/http2-push-content/reviews/#bbp_topic_content">' . __( 'SEND SUGGESTIONS TO IMPROVE','http2-push-content' ) . '</a>' |
| 105 |
), $links ); |
| 106 |
return $links; |
| 107 |
} |
| 108 |
add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'pisol_http2_plugin_link' ); |
| 109 |
} |
| 110 |
|
| 111 |
/** |
| 112 |
* Begins execution of the plugin. |
| 113 |
* |
| 114 |
* Since everything within the plugin is registered via hooks, |
| 115 |
* then kicking off the plugin from this point in the file does |
| 116 |
* not affect the page life cycle. |
| 117 |
* |
| 118 |
* @since 1.0.0 |
| 119 |
*/ |
| 120 |
function run_http2_push_content() { |
| 121 |
|
| 122 |
$plugin = new Http2_Push_Content(); |
| 123 |
$plugin->run(); |
| 124 |
|
| 125 |
} |
| 126 |
run_http2_push_content(); |
| 127 |
|
| 128 |
} |