| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * Description: Hide/Remove Metadata is a free, simple yet extremely handy WordPress plugin that helps you hide author and published date either by CSS or PHP from your website effortlessly. |
| 5 | 5 | * Plugin URI: http://catchplugins.com/plugins/hide-metadata |
| 6 | 6 | * Author: Catch Plugins |
| 7 | 7 | * Author URI: http://catchplugins.com/ |
| 8 | - * Version: 2.0 | |
| 8 | + * Version: 2.1 | |
| 9 | 9 | * License: GPL2 |
| 10 | 10 | * Text Domain: hide-metadata |
| 11 | 11 | * Domain Path: /languages |
| 12 | 12 | */ |
| @@ -33,9 +33,9 @@ | ||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Define Version |
| 36 | 36 | if ( ! defined( 'HIDE_METADATA_VERSION' ) ) { |
| 37 | - define( 'HIDE_METADATA_VERSION', '2.0' ); | |
| 37 | + define( 'HIDE_METADATA_VERSION', '2.1' ); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | if ( ! defined( 'HIDE_METADATA_BASENAME' ) ) { |
| 41 | 41 | define('HIDE_METADATA_BASENAME', plugin_basename(__FILE__)); |
| @@ -77,9 +77,10 @@ | ||
| 77 | 77 | * @since 1.0.0 |
| 78 | 78 | */ |
| 79 | 79 | function enqueue_styles() |
| 80 | 80 | { |
| 81 | - if (isset($_GET['page']) && 'hide-metadata' === $_GET['page']) { | |
| 81 | + $hm_page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page check for admin style loading. | |
| 82 | + if ('hide-metadata' === $hm_page) { | |
| 82 | 83 | wp_enqueue_style($this->plugin_name . '-display-dashboard', plugin_dir_url(__FILE__) . 'css/admin-dashboard.css', array(), $this->version, 'all'); |
| 83 | 84 | } |
| 84 | 85 | } |
| 85 | 86 | |
| @@ -96,9 +97,10 @@ | ||
| 96 | 97 | * @since 1.0.0 |
| 97 | 98 | */ |
| 98 | 99 | function enqueue_scripts() |
| 99 | 100 | { |
| 100 | - if (isset($_GET['page']) && 'hide-metadata' === $_GET['page']) { | |
| 101 | + $hm_page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only page check for admin script loading. | |
| 102 | + if ('hide-metadata' === $hm_page) { | |
| 101 | 103 | wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/hide-metadata-admin.js', array('jquery', 'matchHeight', 'jquery-ui-tooltip'), $this->version, false); |
| 102 | 104 | |
| 103 | 105 | wp_enqueue_script('matchHeight', plugin_dir_url(__FILE__) . 'js/jquery-matchHeight.min.js', array('jquery'), $this->version, false); |
| 104 | 106 | } |
| @@ -114,9 +116,9 @@ | ||
| 114 | 116 | */ |
| 115 | 117 | function action_links($links, $file) |
| 116 | 118 | { |
| 117 | 119 | if ($file === $this->plugin_name . '/' . $this->plugin_name . '.php') { |
| 118 | - $settings_link = '<a href="' . esc_url(admin_url('admin.php?page=hide-metadata')) . '">' . esc_html__('Settings', 'hide-metadata') . '</a>'; | |
| 120 | + $settings_link = '<a href="' . esc_url(admin_url('tools.php?page=hide-metadata')) . '">' . esc_html__('Settings', 'hide-metadata') . '</a>'; | |
| 119 | 121 | |
| 120 | 122 | array_unshift($links, $settings_link); |
| 121 | 123 | } |
| 122 | 124 | return $links; |
| @@ -229,9 +231,8 @@ | ||
| 229 | 231 | add_filter('the_date', '__return_false'); |
| 230 | 232 | add_filter('the_time', '__return_false'); |
| 231 | 233 | add_filter('the_modified_date', '__return_false'); |
| 232 | 234 | add_filter('get_the_date', '__return_false'); |
| 233 | - add_filter('get_the_title', '__return_false'); | |
| 234 | 235 | add_filter('get_the_time', '__return_false'); |
| 235 | 236 | add_filter('get_the_modified_date', '__return_false'); |
| 236 | 237 | } |
| 237 | 238 | } |