| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | Plugin Name: Easy HTTPS (SSL) Redirection |
|---|
| 4 | Plugin URI: https://www.tipsandtricks-hq.com/wordpress-easy-https-redirection-plugin |
|---|
| 5 | Description: The plugin HTTPS Redirection allows an automatic redirection to the "HTTPS" version/URL of the site. |
|---|
| 6 | Author: Tips and Tricks HQ |
|---|
| 7 | Version: 2.0.0 |
|---|
| 8 | Author URI: https://www.tipsandtricks-hq.com/ |
|---|
| 9 | License: GPLv2 or later |
|---|
| 10 | Text Domain: https-redirection |
|---|
| 11 | Domain Path: /languages/ |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | // Prefix: ehssl_ |
|---|
| 15 | |
|---|
| 16 | if (!defined('ABSPATH')) { |
|---|
| 17 | // Exit if accessed directly. |
|---|
| 18 | exit; |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | define('EASY_HTTPS_SSL_VERSION', '2.0.0'); |
|---|
| 22 | //define('EASY_HTTPS_SSL_DB_VERSION', '1.0'); |
|---|
| 23 | |
|---|
| 24 | // Load the core class. |
|---|
| 25 | include_once ( 'easy-https-ssl-core.php' ); |
|---|
| 26 | |
|---|
| 27 | // Activation hook. |
|---|
| 28 | register_activation_hook(__FILE__, array('Easy_HTTPS_SSL', 'plugin_activate_handler')); |
|---|
| 29 | // Deactivation hook |
|---|
| 30 | register_deactivation_hook(__FILE__, array('Easy_HTTPS_SSL', 'plugin_deactivate_handler')); |
|---|
| 31 | |
|---|
| 32 | // Uninstall hook. |
|---|
| 33 | register_uninstall_hook(__FILE__, array('Easy_HTTPS_SSL', 'plugin_uninstall_handler')); |
|---|
| 34 | |
|---|
| 35 | /** |
|---|
| 36 | * Adds "Settings" link to the plugin action page |
|---|
| 37 | */ |
|---|
| 38 | function ehssl_plugin_action_links($links, $file) |
|---|
| 39 | { |
|---|
| 40 | // Static so we don't call plugin_basename on every plugin row. |
|---|
| 41 | static $this_plugin; |
|---|
| 42 | if (!$this_plugin) { |
|---|
| 43 | $this_plugin = plugin_basename(__FILE__); |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | if ($file == $this_plugin) { |
|---|
| 47 | $settings_link = '<a href="admin.php?page=ehssl_settings">' . __('Settings', 'https-redirection') . '</a>'; |
|---|
| 48 | array_unshift($links, $settings_link); |
|---|
| 49 | } |
|---|
| 50 | return $links; |
|---|
| 51 | } |
|---|
| 52 | add_filter('plugin_action_links', 'ehssl_plugin_action_links', 10, 2); |
|---|
| 53 | |
|---|
| 54 | /** |
|---|
| 55 | * Additional links on the plugin page |
|---|
| 56 | */ |
|---|
| 57 | function ehssl_register_plugin_links($links, $file) |
|---|
| 58 | { |
|---|
| 59 | $base = plugin_basename(__FILE__); |
|---|
| 60 | if ($file == $base) { |
|---|
| 61 | $links[] = '<a href="admin.php?page=ehssl_settings">' . __('Settings', 'https-redirection') . '</a>'; |
|---|
| 62 | } |
|---|
| 63 | return $links; |
|---|
| 64 | } |
|---|
| 65 | add_filter('plugin_row_meta', 'ehssl_register_plugin_links', 10, 2); |
|---|