Changeset 3410920
- Timestamp:
- 12/04/2025 12:47:52 PM (10 days ago)
- Location:
- block-wp-login
- Files:
-
- 1 deleted
- 3 edited
- 6 copied
-
tags/1.5.5 (copied) (copied from block-wp-login/trunk)
-
tags/1.5.5/block-wp-login.php (copied) (copied from block-wp-login/trunk/block-wp-login.php) (27 diffs)
-
tags/1.5.5/includes (copied) (copied from block-wp-login/trunk/includes)
-
tags/1.5.5/includes/class-bwpl-common.php (copied) (copied from block-wp-login/trunk/includes/class-bwpl-common.php) (29 diffs)
-
tags/1.5.5/includes/class-webd.php (deleted)
-
tags/1.5.5/includes/customize-controls.js (copied) (copied from block-wp-login/trunk/includes/customize-controls.js)
-
tags/1.5.5/readme.txt (copied) (copied from block-wp-login/trunk/readme.txt) (3 diffs)
-
trunk/block-wp-login.php (modified) (27 diffs)
-
trunk/includes/class-bwpl-common.php (modified) (29 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
block-wp-login/tags/1.5.5/block-wp-login.php
r3284110 r3410920 2 2 /* 3 3 * Plugin Name: Block wp-login 4 * Version: 1.5. 44 * Version: 1.5.5 5 5 * Plugin URI: https://webd.uk/support/ 6 6 * Description: This plugin completely blocks access to wp-login.php and creates a new secret login URL 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: block-wp-login 10 12 */ … … 13 15 14 16 if (!defined('ABSPATH')) { 15 exit( __('This isn\'t the page you\'re looking for. Move along, move along.', 'block-wp-login'));17 exit(esc_html(__('This isn\'t the page you\'re looking for. Move along, move along.', 'block-wp-login'))); 16 18 } 17 19 … … 22 24 class bwpl_class { 23 25 24 public static $version = '1.5. 4';26 public static $version = '1.5.5'; 25 27 26 28 private $bwpl_new_slug = ''; … … 73 75 function bwpl_configure_slug() { 74 76 75 if (isset($_POST['bwpl_nonce']) && wp_verify_nonce( $_POST['bwpl_nonce'], 'bwpl_slug_change') && isset($_POST['bwpl_slug']) && current_user_can('manage_options')) {76 77 $this->bwpl_new_slug = trim(sanitize_key(wp_strip_all_tags( $_POST['bwpl_slug'])));77 if (isset($_POST['bwpl_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['bwpl_nonce'])), 'bwpl_slug_change') && isset($_POST['bwpl_slug']) && current_user_can('manage_options')) { 78 79 $this->bwpl_new_slug = trim(sanitize_key(wp_strip_all_tags(wp_unslash($_POST['bwpl_slug'])))); 78 80 79 81 if ($this->bwpl_new_slug) { 80 82 83 $notify = (isset($_POST['bwpl_notify']) && 'true' === $_POST['bwpl_notify']); 81 84 $this->bwpl_uninstall(); 82 $this->bwpl_install( );85 $this->bwpl_install(false, $notify); 83 86 84 87 } else { … … 126 129 if ( 127 130 isset($_POST['bwpl_unknown_admin']) && 128 $_POST['bwpl_unknown_admin']&&131 sanitize_text_field(wp_unslash($_POST['bwpl_unknown_admin'])) && 129 132 isset($_POST['bwpl_known_ips']) && 130 $_POST['bwpl_known_ips']133 sanitize_textarea_field(wp_unslash($_POST['bwpl_known_ips'])) 131 134 ) { 132 135 133 $known_ips = preg_split('/\r\n|[\r\n]/', $_POST['bwpl_known_ips']);136 $known_ips = preg_split('/\r\n|[\r\n]/', sanitize_textarea_field(wp_unslash($_POST['bwpl_known_ips']))); 134 137 135 138 foreach ($known_ips AS $key => $known_ip) { … … 187 190 for ($i = 0; $i < 8; $i++) { 188 191 189 $randomString .= $characters[ rand(0, strlen($characters) - 1)];192 $randomString .= $characters[wp_rand(0, strlen($characters) - 1)]; 190 193 191 194 } 192 195 193 196 ?> 194 <input id="bwpl_slug" name="bwpl_slug" type="text" class="regular-text code" value="<?php echo get_option('bwpl_slug'); ?>" />197 <input id="bwpl_slug" name="bwpl_slug" type="text" class="regular-text code" value="<?php echo esc_attr(get_option('bwpl_slug')); ?>" /> 195 198 196 199 <script type="text/javascript"> … … 206 209 <p><?php esc_html_e('To change your WordPress login address, enter your chosen slug above. Leave it blank to enable the default login address.', 'block-wp-login'); ?></p> 207 210 208 <p>< ?php printf(esc_html__('%1$sClick here%2$s to generate a random login address.', 'block-wp-login'),'<a href="javascript:void(0)" class="randomlogin">','</a>'); ?></p>211 <p><a href="javascript:void(0)" class="randomlogin"><?php echo esc_html(__('Click here', 'block-wp-login')); ?></a> <?php echo esc_html(__('to generate a random login address.', 'block-wp-login')); ?></p> 209 212 210 213 <script type="text/javascript"> … … 217 220 jQuery('#bwpl_slug').val(result); 218 221 alert(<?php echo json_encode(__('WARNING! DO NOT LOCK YOURSELF OUT! Your new login address will be', 'block-wp-login') . ' ' . get_site_url() . '/'); ?> + result + '/'); 219 jQuery('#bwpl_ slug').val(result);222 jQuery('#bwpl_notify').prop('checked', true); 220 223 }); 221 224 </script> … … 225 228 if (get_option('bwpl_slug')) { 226 229 227 echo get_site_url(null, (get_option('bwpl_slug') . '/'));230 echo esc_url(get_site_url(null, (get_option('bwpl_slug') . '/'))); 228 231 229 232 } else { 230 233 231 echo get_site_url(null, 'wp-login.php');234 echo esc_url(get_site_url(null, 'wp-login.php')); 232 235 233 236 } ?></p> … … 257 260 <p><strong><?php esc_html_e('Please Note: ', 'block-wp-login'); ?></strong><?php 258 261 259 printf( 262 echo wp_kses(sprintf( 263 /* translators: link to plugin install page */ 260 264 __('To lock down your website to only serve legitimate content, please take a look at our new plugin "%s".', 'block-wp-login'), 261 '<a href="' . esc_url(add_query_arg(array('s' => 'deny-all-firewall+genuine', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php'))) . '" title="' . __('Deny All Firewall', 'block-wp-login') . '">' . __('Deny All Firewall', 'block-wp-login') . '</a>'262 ) ;265 '<a href="' . esc_url(add_query_arg(array('s' => 'deny-all-firewall+genuine', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php'))) . '" title="' . esc_attr(__('Deny All Firewall', 'block-wp-login')) . '">' . __('Deny All Firewall', 'block-wp-login') . '</a>' 266 ), 'post'); 263 267 264 268 ?></p> … … 287 291 } 288 292 289 function bwpl_install($new_version = false) { 290 291 if ($new_version || (isset($_POST['bwpl_notify']) && 'true' === $_POST['bwpl_notify'])) { 293 function bwpl_install($new_version = false, $notify = true) { 294 295 global $wp_filesystem; 296 297 if (!$wp_filesystem) { 298 299 require_once (ABSPATH . '/wp-admin/includes/file.php'); 300 301 WP_Filesystem(); 302 303 } 304 305 if ($new_version || $notify) { 292 306 293 307 $this->bwpl_send_emails($new_version); … … 301 315 $content = implode($this->bwpl_new_slug . '-wp-login.php', $content_chunks); 302 316 303 if ((!file_exists(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php') && is_writable(bwplCommon::get_home_path())) ||is_writable(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php')) {317 if ((!file_exists(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php') && $wp_filesystem->is_writable(bwplCommon::get_home_path())) || $wp_filesystem->is_writable(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php')) { 304 318 305 319 file_put_contents(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php', $content); … … 309 323 } 310 324 311 if ((!file_exists(bwplCommon::get_home_path() . '.htaccess') && is_writable(bwplCommon::get_home_path())) ||is_writable(bwplCommon::get_home_path() . '.htaccess')) {325 if ((!file_exists(bwplCommon::get_home_path() . '.htaccess') && $wp_filesystem->is_writable(bwplCommon::get_home_path())) || $wp_filesystem->is_writable(bwplCommon::get_home_path() . '.htaccess')) { 312 326 313 327 $markerdata = file(bwplCommon::get_home_path() . '.htaccess'); … … 346 360 } 347 361 348 $f = @fopen(bwplCommon::get_home_path() . '.htaccess', 'w'); 349 fwrite($f, $newdata); 362 $wp_filesystem->put_contents( 363 bwplCommon::get_home_path() . '.htaccess', 364 $newdata, 365 FS_CHMOD_FILE 366 ); 350 367 351 368 } … … 361 378 ?> 362 379 <div class="notice notice-success"> 363 <p><?php printf(esc_html__('%1$sBlock wp-login%2$s activated. ', 'block-wp-login'),'<strong>','</strong>'); ?><a href="<?php echo admin_url('options-permalink.php'); ?>"><?php esc_html_e('Configure the plugin here.', 'block-wp-login'); ?></a></p> 380 <p><?php 381 /* translators: <strong> HTML tags */ 382 echo wp_kses(sprintf(__('%1$sBlock wp-login%2$s activated. ', 'block-wp-login'),'<strong>','</strong>'), 'post'); ?><a href="<?php echo esc_url(admin_url('options-permalink.php')); ?>"><?php esc_html_e('Configure the plugin here.', 'block-wp-login'); ?></a></p> 364 383 </div> 365 384 <?php … … 369 388 function bwpl_uninstall() { 370 389 371 if (is_writable(bwplCommon::get_home_path() . '.htaccess')) { 390 global $wp_filesystem; 391 392 if (!$wp_filesystem) { 393 394 require_once (ABSPATH . '/wp-admin/includes/file.php'); 395 396 WP_Filesystem(); 397 398 } 399 400 if ($wp_filesystem->is_writable(bwplCommon::get_home_path() . '.htaccess')) { 372 401 373 402 $markerdata = file(bwplCommon::get_home_path() . '.htaccess'); … … 424 453 } 425 454 426 $f = @fopen(bwplCommon::get_home_path() . '.htaccess', 'w'); 427 fwrite($f, $newdata); 455 $wp_filesystem->put_contents( 456 bwplCommon::get_home_path() . '.htaccess', 457 $newdata, 458 FS_CHMOD_FILE 459 ); 428 460 429 461 } … … 435 467 add_filter('lostpassword_url', array($this, 'bwpl_reset_logout_url')); 436 468 437 if ( is_writable(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php') && get_option('bwpl_slug')) {438 439 unlink(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php');469 if ($wp_filesystem->is_writable(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php') && get_option('bwpl_slug')) { 470 471 wp_delete_file(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php'); 440 472 441 473 } … … 525 557 if ($new_version) { 526 558 527 $message = __('A new version of WordPress has been detected so we have reinstalled "Block wp-login" and here is a reminder of your login URL:', 'block-wp-login') . "\r\n\r\n";559 $message = __('A recent WordPress core update has been detected and “Block wp-login” has been re-installed. Here is a reminder of your login address:', 'block-wp-login'); 528 560 529 561 } else { 530 562 531 $message = __('Your WordPress login URL has been changed:', 'block-wp-login') . "\r\n\r\n"; 532 533 } 563 $message = __('Your WordPress login address has been changed:', 'block-wp-login'); 564 565 } 566 567 $message .= "\r\n\r\n"; 534 568 535 569 if ($this->bwpl_new_slug) { … … 543 577 } 544 578 545 $message .= __('Make sure you save this email and / or bookmark this address so you don\'t get locked out!', 'block-wp-login') . "\r\n\r\n"; 546 $message .= __('Contact us if you are having trouble with WordPress https://webd.uk', 'block-wp-login') . "\r\n\r\n"; 547 $message .= __('If you like our plugin please leave a short review: https://wordpress.org/support/plugin/block-wp-login/reviews/#new-post', 'block-wp-login') . "\r\n\r\n"; 579 $message .= __('Keep this link handy! Bookmarking it is the best way to ensure you never get locked out.', 'block-wp-login'); 580 $message .= "\r\n\r\n---\r\n\r\n"; 581 $message .= __('Does your site need a glow-up?', 'block-wp-login'); 582 $message .= "\r\n"; 583 $message .= __('Running slowly?', 'block-wp-login'); 584 $message .= "\r\n"; 585 $message .= __('Want new features?', 'block-wp-login'); 586 $message .= "\r\n\r\n"; 587 $message .= __('See how we can help', 'block-wp-login'); 588 $message .= ' https://webd.uk'; 548 589 549 590 if (is_multisite()) { … … 559 600 if ($new_version) { 560 601 602 /* translators: website title */ 561 603 $title = sprintf(__('[%s] WordPress Login Reminder', 'block-wp-login'), $blogname); 562 604 563 605 } else { 564 606 607 /* translators: website title */ 565 608 $title = sprintf(__('[%s] WordPress Login Changed', 'block-wp-login'), $blogname); 566 609 … … 579 622 ?> 580 623 <div class="notice notice-error"> 581 <p><?php printf(esc_html__('%1$sBlock wp-login%2$s activated email could not be sent.', 'block-wp-login'),'<strong>','</strong>'); ?></p> 624 <p><?php 625 /* translators: <strong> HTML tags */ 626 wp_kses(sprintf(__('%1$sBlock wp-login%2$s activated email could not be sent.', 'block-wp-login'),'<strong>','</strong>'), 'post'); ?></p> 582 627 </div> 583 628 <?php … … 655 700 } 656 701 702 /* translators: website title */ 657 703 $title = sprintf(__('[%s] WordPress Login Alert', 'block-wp-login'), $blogname); 658 704 … … 681 727 if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { 682 728 683 $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];729 $ip = filter_var(wp_unslash($_SERVER['HTTP_CF_CONNECTING_IP']), FILTER_VALIDATE_IP); 684 730 685 731 } elseif (isset($_SERVER['REMOTE_ADDR'])) { 686 732 687 $ip = $_SERVER['REMOTE_ADDR'];733 $ip = filter_var(wp_unslash($_SERVER['REMOTE_ADDR']), FILTER_VALIDATE_IP); 688 734 689 735 } … … 710 756 global $wpdb; 711 757 758 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 712 759 return (bool) $wpdb->get_var($wpdb->prepare("SELECT GET_LOCK(%s, %d)", 'bwpl_lock', 0)); 713 760 … … 718 765 global $wpdb; 719 766 767 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 720 768 return (bool) $wpdb->get_var($wpdb->prepare("SELECT RELEASE_LOCK(%s)", 'bwpl_lock')); 721 769 … … 730 778 } 731 779 732 $Block_wp_login =new bwpl_class();780 new bwpl_class(); 733 781 734 782 } -
block-wp-login/tags/1.5.5/includes/class-bwpl-common.php
r2986003 r3410920 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'block-wp-login'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'block-wp-login' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'block-wp-login'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'block-wp-login'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'block-wp-login') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'block-wp-login') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'block-wp-login' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'block-wp-login'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css;240 echo wp_kses($generated_css, 'strip'); 237 241 238 242 } elseif ($mod) { 239 243 240 244 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css;245 echo wp_kses($generated_css, 'strip'); 242 246 243 247 } … … 249 253 if (self::$plugin_premium_class) { 250 254 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 255 if (isset($_SERVER['HTTP_HOST'])) { 256 257 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'block-wp-login' . '-upgrade/'); 258 259 } else { 260 261 return 'https://webd.uk/product/' . 'block-wp-login' . '-upgrade/'; 262 263 } 253 264 254 265 } else { … … 276 287 $settings_links = array(); 277 288 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';289 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'block-wp-login')) . '">' . __('Settings', 'block-wp-login') . '</a>'; 279 290 280 291 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 295 if (self::$plugin_upgrade) { 285 296 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 297 /* translators: name of the plugin */ 298 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'block-wp-login'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'block-wp-login') . '</a>'; 287 299 288 300 } else { 289 301 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 302 /* translators: name of the plugin */ 303 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'block-wp-login'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'block-wp-login') . '</a>'; 291 304 292 305 } … … 294 307 } else { 295 308 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 309 /* translators: name of the plugin */ 310 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name) : sprintf(__('Contribute to %s', 'block-wp-login'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'block-wp-login') : __('Support Us', 'block-wp-login')) . '</a>'; 297 311 298 312 } … … 300 314 if ($premium) { 301 315 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 316 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'block-wp-login')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'block-wp-login') . '</a>'; 317 318 } elseif (self::$plugin_trial && !is_plugin_active('block-wp-login' . '-premium/' . 'block-wp-login' . '-premium.php')) { 319 320 /* translators: name of the plugin */ 321 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'block-wp-login'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'block-wp-login') . '</a>'; 307 322 308 323 } … … 310 325 } elseif ($premium) { 311 326 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';327 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'block-wp-login') . '</strong>'; 313 328 314 329 } … … 320 335 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 336 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 337 if ($plugin_file === 'block-wp-login' . '/' . 'block-wp-login' . '.php') { 338 339 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'block-wp-login') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'block-wp-login') . '</a>'; 340 /* translators: name of the plugin */ 341 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'block-wp-login' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'block-wp-login'), self::$plugin_name)) . '">' . __('Review plugin', 'block-wp-login') . '</a>'; 326 342 327 343 } … … 357 373 ?> 358 374 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 376 377 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 378 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'block-wp-login'); ?></p> 379 380 <p><a href="<?php 381 /* translators: name of the plugin */ 382 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a></p> 365 383 366 384 </div> 367 385 368 386 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {387 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 388 jQuery.ajax({ 371 389 url: ajaxurl, 372 390 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'391 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 392 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 393 } 376 394 }); … … 384 402 ?> 385 403 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 404 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 405 406 <p><strong><?php 407 /* translators: name of the plugin */ 408 printf(esc_html(__('Thank you for using %s plugin', 'block-wp-login')), esc_html(self::$plugin_name)); ?></strong><br /> 389 409 <?php 390 410 391 411 if (self::$plugin_trial == true) { 392 412 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);413 echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'block-wp-login')); 394 414 395 415 } else { 396 416 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 417 /* translators: name of the plugin */ 418 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'block-wp-login'), self::$plugin_name)); 398 419 399 420 } … … 407 428 ?> 408 429 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 430 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php 431 /* translators: name of the plugin */ 432 echo esc_attr(sprintf(__('Try %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Trial %s Premium for 7 days', 'block-wp-login'), self::$plugin_name)); ?></a> 410 433 411 434 <?php … … 414 437 415 438 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 439 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 440 /* translators: name of the plugin */ 441 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Upgrade now to %s Premium', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a></p> 417 442 418 443 </div> 419 444 420 445 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {446 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 447 jQuery.ajax({ 423 448 url: ajaxurl, 424 449 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'450 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 451 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 452 } 428 453 }); … … 434 459 } 435 460 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 461 } elseif ( 462 time() > (strtotime('+1 hour', filectime(__DIR__))) && 463 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 464 !get_option(self::$plugin_prefix . '_donated') 465 ) { 466 467 ?> 468 469 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 470 <p><strong><?php 471 /* translators: name of the plugin */ 472 printf(esc_html(__('Thank you for using %s plugin', 'block-wp-login')), esc_html(self::$plugin_name)); ?></strong></p> 473 <?php 474 475 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 476 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 477 446 478 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 479 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'block-wp-login'); ?></p> 480 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 481 /* translators: name of the plugin */ 482 echo esc_attr(sprintf(__('Contribute to %s', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'block-wp-login')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'block-wp-login'); ?></a></p> 449 483 </div> 450 484 451 485 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()486 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 487 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'block-wp-login')); ?>)) { 488 alert(<?php echo json_encode(__('Thank you!', 'block-wp-login')); ?>); 489 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 490 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 491 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 492 }); 459 493 }); … … 461 495 url: ajaxurl, 462 496 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',497 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 498 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'499 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 500 } 467 501 }); 468 502 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');503 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 504 } 471 505 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {506 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 507 jQuery.ajax({ 474 508 url: ajaxurl, 475 509 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'510 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 511 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 512 } 479 513 }); … … 509 543 is_admin() && 510 544 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 545 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 546 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 547 ) && !( 514 548 !is_admin() && 515 549 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 550 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 551 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 552 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 553 ) 520 554 ) { … … 530 564 is_admin() && 531 565 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 566 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 567 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 568 ) || ( 535 569 !is_admin() && 536 570 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 571 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 572 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 573 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 574 )) 541 575 ) { … … 549 583 !is_admin() && 550 584 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 585 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 586 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 587 554 588 ) { 555 589 556 $child = wp_get_theme( $_GET['customize_theme']);590 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 591 558 592 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 602 is_admin() && 569 603 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 604 ( 605 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 606 ( 607 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 608 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 609 ) 610 ) 571 611 ) { 572 612 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);613 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 614 615 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 616 577 617 } else { 578 618 579 $child = wp_get_theme( $_POST['customize_theme']);619 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 620 581 621 } … … 622 662 623 663 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>664 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 665 <?php 626 666 … … 647 687 ?> 648 688 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />689 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 690 <?php 651 691 -
block-wp-login/tags/1.5.5/readme.txt
r3284110 r3410920 4 4 Tags: security, secure, login security, block hackers, security plugin 5 5 Requires at least: 3.5.0 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.5. 48 Stable tag: 1.5.5 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 44 44 45 45 == Changelog == 46 47 = 1.5.5 = 48 * Fix a minor bug and general housekeeping preparing for "Plugin Check" code review 46 49 47 50 = 1.5.4 = … … 178 181 == Upgrade Notice == 179 182 180 = 1.5. 4=181 * Updated race condition prevention when WordPress core version changes183 = 1.5.5 = 184 * Fix a minor bug and general housekeeping preparing for "Plugin Check" code review -
block-wp-login/trunk/block-wp-login.php
r3284110 r3410920 2 2 /* 3 3 * Plugin Name: Block wp-login 4 * Version: 1.5. 44 * Version: 1.5.5 5 5 * Plugin URI: https://webd.uk/support/ 6 6 * Description: This plugin completely blocks access to wp-login.php and creates a new secret login URL 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: block-wp-login 10 12 */ … … 13 15 14 16 if (!defined('ABSPATH')) { 15 exit( __('This isn\'t the page you\'re looking for. Move along, move along.', 'block-wp-login'));17 exit(esc_html(__('This isn\'t the page you\'re looking for. Move along, move along.', 'block-wp-login'))); 16 18 } 17 19 … … 22 24 class bwpl_class { 23 25 24 public static $version = '1.5. 4';26 public static $version = '1.5.5'; 25 27 26 28 private $bwpl_new_slug = ''; … … 73 75 function bwpl_configure_slug() { 74 76 75 if (isset($_POST['bwpl_nonce']) && wp_verify_nonce( $_POST['bwpl_nonce'], 'bwpl_slug_change') && isset($_POST['bwpl_slug']) && current_user_can('manage_options')) {76 77 $this->bwpl_new_slug = trim(sanitize_key(wp_strip_all_tags( $_POST['bwpl_slug'])));77 if (isset($_POST['bwpl_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['bwpl_nonce'])), 'bwpl_slug_change') && isset($_POST['bwpl_slug']) && current_user_can('manage_options')) { 78 79 $this->bwpl_new_slug = trim(sanitize_key(wp_strip_all_tags(wp_unslash($_POST['bwpl_slug'])))); 78 80 79 81 if ($this->bwpl_new_slug) { 80 82 83 $notify = (isset($_POST['bwpl_notify']) && 'true' === $_POST['bwpl_notify']); 81 84 $this->bwpl_uninstall(); 82 $this->bwpl_install( );85 $this->bwpl_install(false, $notify); 83 86 84 87 } else { … … 126 129 if ( 127 130 isset($_POST['bwpl_unknown_admin']) && 128 $_POST['bwpl_unknown_admin']&&131 sanitize_text_field(wp_unslash($_POST['bwpl_unknown_admin'])) && 129 132 isset($_POST['bwpl_known_ips']) && 130 $_POST['bwpl_known_ips']133 sanitize_textarea_field(wp_unslash($_POST['bwpl_known_ips'])) 131 134 ) { 132 135 133 $known_ips = preg_split('/\r\n|[\r\n]/', $_POST['bwpl_known_ips']);136 $known_ips = preg_split('/\r\n|[\r\n]/', sanitize_textarea_field(wp_unslash($_POST['bwpl_known_ips']))); 134 137 135 138 foreach ($known_ips AS $key => $known_ip) { … … 187 190 for ($i = 0; $i < 8; $i++) { 188 191 189 $randomString .= $characters[ rand(0, strlen($characters) - 1)];192 $randomString .= $characters[wp_rand(0, strlen($characters) - 1)]; 190 193 191 194 } 192 195 193 196 ?> 194 <input id="bwpl_slug" name="bwpl_slug" type="text" class="regular-text code" value="<?php echo get_option('bwpl_slug'); ?>" />197 <input id="bwpl_slug" name="bwpl_slug" type="text" class="regular-text code" value="<?php echo esc_attr(get_option('bwpl_slug')); ?>" /> 195 198 196 199 <script type="text/javascript"> … … 206 209 <p><?php esc_html_e('To change your WordPress login address, enter your chosen slug above. Leave it blank to enable the default login address.', 'block-wp-login'); ?></p> 207 210 208 <p>< ?php printf(esc_html__('%1$sClick here%2$s to generate a random login address.', 'block-wp-login'),'<a href="javascript:void(0)" class="randomlogin">','</a>'); ?></p>211 <p><a href="javascript:void(0)" class="randomlogin"><?php echo esc_html(__('Click here', 'block-wp-login')); ?></a> <?php echo esc_html(__('to generate a random login address.', 'block-wp-login')); ?></p> 209 212 210 213 <script type="text/javascript"> … … 217 220 jQuery('#bwpl_slug').val(result); 218 221 alert(<?php echo json_encode(__('WARNING! DO NOT LOCK YOURSELF OUT! Your new login address will be', 'block-wp-login') . ' ' . get_site_url() . '/'); ?> + result + '/'); 219 jQuery('#bwpl_ slug').val(result);222 jQuery('#bwpl_notify').prop('checked', true); 220 223 }); 221 224 </script> … … 225 228 if (get_option('bwpl_slug')) { 226 229 227 echo get_site_url(null, (get_option('bwpl_slug') . '/'));230 echo esc_url(get_site_url(null, (get_option('bwpl_slug') . '/'))); 228 231 229 232 } else { 230 233 231 echo get_site_url(null, 'wp-login.php');234 echo esc_url(get_site_url(null, 'wp-login.php')); 232 235 233 236 } ?></p> … … 257 260 <p><strong><?php esc_html_e('Please Note: ', 'block-wp-login'); ?></strong><?php 258 261 259 printf( 262 echo wp_kses(sprintf( 263 /* translators: link to plugin install page */ 260 264 __('To lock down your website to only serve legitimate content, please take a look at our new plugin "%s".', 'block-wp-login'), 261 '<a href="' . esc_url(add_query_arg(array('s' => 'deny-all-firewall+genuine', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php'))) . '" title="' . __('Deny All Firewall', 'block-wp-login') . '">' . __('Deny All Firewall', 'block-wp-login') . '</a>'262 ) ;265 '<a href="' . esc_url(add_query_arg(array('s' => 'deny-all-firewall+genuine', 'tab' => 'search', 'type' => 'term'), self_admin_url('plugin-install.php'))) . '" title="' . esc_attr(__('Deny All Firewall', 'block-wp-login')) . '">' . __('Deny All Firewall', 'block-wp-login') . '</a>' 266 ), 'post'); 263 267 264 268 ?></p> … … 287 291 } 288 292 289 function bwpl_install($new_version = false) { 290 291 if ($new_version || (isset($_POST['bwpl_notify']) && 'true' === $_POST['bwpl_notify'])) { 293 function bwpl_install($new_version = false, $notify = true) { 294 295 global $wp_filesystem; 296 297 if (!$wp_filesystem) { 298 299 require_once (ABSPATH . '/wp-admin/includes/file.php'); 300 301 WP_Filesystem(); 302 303 } 304 305 if ($new_version || $notify) { 292 306 293 307 $this->bwpl_send_emails($new_version); … … 301 315 $content = implode($this->bwpl_new_slug . '-wp-login.php', $content_chunks); 302 316 303 if ((!file_exists(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php') && is_writable(bwplCommon::get_home_path())) ||is_writable(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php')) {317 if ((!file_exists(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php') && $wp_filesystem->is_writable(bwplCommon::get_home_path())) || $wp_filesystem->is_writable(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php')) { 304 318 305 319 file_put_contents(bwplCommon::get_home_path() . $this->bwpl_new_slug . '-wp-login.php', $content); … … 309 323 } 310 324 311 if ((!file_exists(bwplCommon::get_home_path() . '.htaccess') && is_writable(bwplCommon::get_home_path())) ||is_writable(bwplCommon::get_home_path() . '.htaccess')) {325 if ((!file_exists(bwplCommon::get_home_path() . '.htaccess') && $wp_filesystem->is_writable(bwplCommon::get_home_path())) || $wp_filesystem->is_writable(bwplCommon::get_home_path() . '.htaccess')) { 312 326 313 327 $markerdata = file(bwplCommon::get_home_path() . '.htaccess'); … … 346 360 } 347 361 348 $f = @fopen(bwplCommon::get_home_path() . '.htaccess', 'w'); 349 fwrite($f, $newdata); 362 $wp_filesystem->put_contents( 363 bwplCommon::get_home_path() . '.htaccess', 364 $newdata, 365 FS_CHMOD_FILE 366 ); 350 367 351 368 } … … 361 378 ?> 362 379 <div class="notice notice-success"> 363 <p><?php printf(esc_html__('%1$sBlock wp-login%2$s activated. ', 'block-wp-login'),'<strong>','</strong>'); ?><a href="<?php echo admin_url('options-permalink.php'); ?>"><?php esc_html_e('Configure the plugin here.', 'block-wp-login'); ?></a></p> 380 <p><?php 381 /* translators: <strong> HTML tags */ 382 echo wp_kses(sprintf(__('%1$sBlock wp-login%2$s activated. ', 'block-wp-login'),'<strong>','</strong>'), 'post'); ?><a href="<?php echo esc_url(admin_url('options-permalink.php')); ?>"><?php esc_html_e('Configure the plugin here.', 'block-wp-login'); ?></a></p> 364 383 </div> 365 384 <?php … … 369 388 function bwpl_uninstall() { 370 389 371 if (is_writable(bwplCommon::get_home_path() . '.htaccess')) { 390 global $wp_filesystem; 391 392 if (!$wp_filesystem) { 393 394 require_once (ABSPATH . '/wp-admin/includes/file.php'); 395 396 WP_Filesystem(); 397 398 } 399 400 if ($wp_filesystem->is_writable(bwplCommon::get_home_path() . '.htaccess')) { 372 401 373 402 $markerdata = file(bwplCommon::get_home_path() . '.htaccess'); … … 424 453 } 425 454 426 $f = @fopen(bwplCommon::get_home_path() . '.htaccess', 'w'); 427 fwrite($f, $newdata); 455 $wp_filesystem->put_contents( 456 bwplCommon::get_home_path() . '.htaccess', 457 $newdata, 458 FS_CHMOD_FILE 459 ); 428 460 429 461 } … … 435 467 add_filter('lostpassword_url', array($this, 'bwpl_reset_logout_url')); 436 468 437 if ( is_writable(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php') && get_option('bwpl_slug')) {438 439 unlink(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php');469 if ($wp_filesystem->is_writable(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php') && get_option('bwpl_slug')) { 470 471 wp_delete_file(bwplCommon::get_home_path() . get_option('bwpl_slug') . '-wp-login.php'); 440 472 441 473 } … … 525 557 if ($new_version) { 526 558 527 $message = __('A new version of WordPress has been detected so we have reinstalled "Block wp-login" and here is a reminder of your login URL:', 'block-wp-login') . "\r\n\r\n";559 $message = __('A recent WordPress core update has been detected and “Block wp-login” has been re-installed. Here is a reminder of your login address:', 'block-wp-login'); 528 560 529 561 } else { 530 562 531 $message = __('Your WordPress login URL has been changed:', 'block-wp-login') . "\r\n\r\n"; 532 533 } 563 $message = __('Your WordPress login address has been changed:', 'block-wp-login'); 564 565 } 566 567 $message .= "\r\n\r\n"; 534 568 535 569 if ($this->bwpl_new_slug) { … … 543 577 } 544 578 545 $message .= __('Make sure you save this email and / or bookmark this address so you don\'t get locked out!', 'block-wp-login') . "\r\n\r\n"; 546 $message .= __('Contact us if you are having trouble with WordPress https://webd.uk', 'block-wp-login') . "\r\n\r\n"; 547 $message .= __('If you like our plugin please leave a short review: https://wordpress.org/support/plugin/block-wp-login/reviews/#new-post', 'block-wp-login') . "\r\n\r\n"; 579 $message .= __('Keep this link handy! Bookmarking it is the best way to ensure you never get locked out.', 'block-wp-login'); 580 $message .= "\r\n\r\n---\r\n\r\n"; 581 $message .= __('Does your site need a glow-up?', 'block-wp-login'); 582 $message .= "\r\n"; 583 $message .= __('Running slowly?', 'block-wp-login'); 584 $message .= "\r\n"; 585 $message .= __('Want new features?', 'block-wp-login'); 586 $message .= "\r\n\r\n"; 587 $message .= __('See how we can help', 'block-wp-login'); 588 $message .= ' https://webd.uk'; 548 589 549 590 if (is_multisite()) { … … 559 600 if ($new_version) { 560 601 602 /* translators: website title */ 561 603 $title = sprintf(__('[%s] WordPress Login Reminder', 'block-wp-login'), $blogname); 562 604 563 605 } else { 564 606 607 /* translators: website title */ 565 608 $title = sprintf(__('[%s] WordPress Login Changed', 'block-wp-login'), $blogname); 566 609 … … 579 622 ?> 580 623 <div class="notice notice-error"> 581 <p><?php printf(esc_html__('%1$sBlock wp-login%2$s activated email could not be sent.', 'block-wp-login'),'<strong>','</strong>'); ?></p> 624 <p><?php 625 /* translators: <strong> HTML tags */ 626 wp_kses(sprintf(__('%1$sBlock wp-login%2$s activated email could not be sent.', 'block-wp-login'),'<strong>','</strong>'), 'post'); ?></p> 582 627 </div> 583 628 <?php … … 655 700 } 656 701 702 /* translators: website title */ 657 703 $title = sprintf(__('[%s] WordPress Login Alert', 'block-wp-login'), $blogname); 658 704 … … 681 727 if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { 682 728 683 $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];729 $ip = filter_var(wp_unslash($_SERVER['HTTP_CF_CONNECTING_IP']), FILTER_VALIDATE_IP); 684 730 685 731 } elseif (isset($_SERVER['REMOTE_ADDR'])) { 686 732 687 $ip = $_SERVER['REMOTE_ADDR'];733 $ip = filter_var(wp_unslash($_SERVER['REMOTE_ADDR']), FILTER_VALIDATE_IP); 688 734 689 735 } … … 710 756 global $wpdb; 711 757 758 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 712 759 return (bool) $wpdb->get_var($wpdb->prepare("SELECT GET_LOCK(%s, %d)", 'bwpl_lock', 0)); 713 760 … … 718 765 global $wpdb; 719 766 767 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 720 768 return (bool) $wpdb->get_var($wpdb->prepare("SELECT RELEASE_LOCK(%s)", 'bwpl_lock')); 721 769 … … 730 778 } 731 779 732 $Block_wp_login =new bwpl_class();780 new bwpl_class(); 733 781 734 782 } -
block-wp-login/trunk/includes/class-bwpl-common.php
r2986003 r3410920 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'block-wp-login'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'block-wp-login' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'block-wp-login'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'block-wp-login'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'block-wp-login') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'block-wp-login') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'block-wp-login' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'block-wp-login'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css;240 echo wp_kses($generated_css, 'strip'); 237 241 238 242 } elseif ($mod) { 239 243 240 244 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css;245 echo wp_kses($generated_css, 'strip'); 242 246 243 247 } … … 249 253 if (self::$plugin_premium_class) { 250 254 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 255 if (isset($_SERVER['HTTP_HOST'])) { 256 257 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'block-wp-login' . '-upgrade/'); 258 259 } else { 260 261 return 'https://webd.uk/product/' . 'block-wp-login' . '-upgrade/'; 262 263 } 253 264 254 265 } else { … … 276 287 $settings_links = array(); 277 288 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';289 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'block-wp-login')) . '">' . __('Settings', 'block-wp-login') . '</a>'; 279 290 280 291 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 295 if (self::$plugin_upgrade) { 285 296 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 297 /* translators: name of the plugin */ 298 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'block-wp-login'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'block-wp-login') . '</a>'; 287 299 288 300 } else { 289 301 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 302 /* translators: name of the plugin */ 303 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'block-wp-login'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'block-wp-login') . '</a>'; 291 304 292 305 } … … 294 307 } else { 295 308 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 309 /* translators: name of the plugin */ 310 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name) : sprintf(__('Contribute to %s', 'block-wp-login'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'block-wp-login') : __('Support Us', 'block-wp-login')) . '</a>'; 297 311 298 312 } … … 300 314 if ($premium) { 301 315 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 316 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'block-wp-login')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'block-wp-login') . '</a>'; 317 318 } elseif (self::$plugin_trial && !is_plugin_active('block-wp-login' . '-premium/' . 'block-wp-login' . '-premium.php')) { 319 320 /* translators: name of the plugin */ 321 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'block-wp-login'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'block-wp-login') . '</a>'; 307 322 308 323 } … … 310 325 } elseif ($premium) { 311 326 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';327 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'block-wp-login') . '</strong>'; 313 328 314 329 } … … 320 335 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 336 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 337 if ($plugin_file === 'block-wp-login' . '/' . 'block-wp-login' . '.php') { 338 339 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'block-wp-login') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'block-wp-login') . '</a>'; 340 /* translators: name of the plugin */ 341 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'block-wp-login' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'block-wp-login'), self::$plugin_name)) . '">' . __('Review plugin', 'block-wp-login') . '</a>'; 326 342 327 343 } … … 357 373 ?> 358 374 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 376 377 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 378 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'block-wp-login'); ?></p> 379 380 <p><a href="<?php 381 /* translators: name of the plugin */ 382 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a></p> 365 383 366 384 </div> 367 385 368 386 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {387 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 388 jQuery.ajax({ 371 389 url: ajaxurl, 372 390 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'391 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 392 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 393 } 376 394 }); … … 384 402 ?> 385 403 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 404 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 405 406 <p><strong><?php 407 /* translators: name of the plugin */ 408 printf(esc_html(__('Thank you for using %s plugin', 'block-wp-login')), esc_html(self::$plugin_name)); ?></strong><br /> 389 409 <?php 390 410 391 411 if (self::$plugin_trial == true) { 392 412 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);413 echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'block-wp-login')); 394 414 395 415 } else { 396 416 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 417 /* translators: name of the plugin */ 418 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'block-wp-login'), self::$plugin_name)); 398 419 399 420 } … … 407 428 ?> 408 429 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 430 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php 431 /* translators: name of the plugin */ 432 echo esc_attr(sprintf(__('Try %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Trial %s Premium for 7 days', 'block-wp-login'), self::$plugin_name)); ?></a> 410 433 411 434 <?php … … 414 437 415 438 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 439 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 440 /* translators: name of the plugin */ 441 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Upgrade now to %s Premium', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a></p> 417 442 418 443 </div> 419 444 420 445 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {446 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 447 jQuery.ajax({ 423 448 url: ajaxurl, 424 449 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'450 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 451 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 452 } 428 453 }); … … 434 459 } 435 460 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 461 } elseif ( 462 time() > (strtotime('+1 hour', filectime(__DIR__))) && 463 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 464 !get_option(self::$plugin_prefix . '_donated') 465 ) { 466 467 ?> 468 469 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 470 <p><strong><?php 471 /* translators: name of the plugin */ 472 printf(esc_html(__('Thank you for using %s plugin', 'block-wp-login')), esc_html(self::$plugin_name)); ?></strong></p> 473 <?php 474 475 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 476 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 477 446 478 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 479 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'block-wp-login'); ?></p> 480 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 481 /* translators: name of the plugin */ 482 echo esc_attr(sprintf(__('Contribute to %s', 'block-wp-login'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'block-wp-login')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'block-wp-login')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'block-wp-login'); ?></a></p> 449 483 </div> 450 484 451 485 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()486 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 487 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'block-wp-login')); ?>)) { 488 alert(<?php echo json_encode(__('Thank you!', 'block-wp-login')); ?>); 489 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 490 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 491 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 492 }); 459 493 }); … … 461 495 url: ajaxurl, 462 496 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',497 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 498 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'499 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 500 } 467 501 }); 468 502 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');503 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 504 } 471 505 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {506 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 507 jQuery.ajax({ 474 508 url: ajaxurl, 475 509 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'510 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 511 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 512 } 479 513 }); … … 509 543 is_admin() && 510 544 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 545 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 546 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 547 ) && !( 514 548 !is_admin() && 515 549 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 550 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 551 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 552 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 553 ) 520 554 ) { … … 530 564 is_admin() && 531 565 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 566 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 567 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 568 ) || ( 535 569 !is_admin() && 536 570 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 571 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 572 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 573 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 574 )) 541 575 ) { … … 549 583 !is_admin() && 550 584 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 585 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 586 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 587 554 588 ) { 555 589 556 $child = wp_get_theme( $_GET['customize_theme']);590 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 591 558 592 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 602 is_admin() && 569 603 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 604 ( 605 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 606 ( 607 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 608 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 609 ) 610 ) 571 611 ) { 572 612 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);613 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 614 615 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 616 577 617 } else { 578 618 579 $child = wp_get_theme( $_POST['customize_theme']);619 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 620 581 621 } … … 622 662 623 663 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>664 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 665 <?php 626 666 … … 647 687 ?> 648 688 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />689 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 690 <?php 651 691 -
block-wp-login/trunk/readme.txt
r3284110 r3410920 4 4 Tags: security, secure, login security, block hackers, security plugin 5 5 Requires at least: 3.5.0 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.5. 48 Stable tag: 1.5.5 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 44 44 45 45 == Changelog == 46 47 = 1.5.5 = 48 * Fix a minor bug and general housekeeping preparing for "Plugin Check" code review 46 49 47 50 = 1.5.4 = … … 178 181 == Upgrade Notice == 179 182 180 = 1.5. 4=181 * Updated race condition prevention when WordPress core version changes183 = 1.5.5 = 184 * Fix a minor bug and general housekeeping preparing for "Plugin Check" code review
Note: See TracChangeset
for help on using the changeset viewer.