Guest User

Untitled

a guest
Jan 22nd, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP8 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 8.1.0.9
  8. * @ Author : DeZender
  9. * @ Release on : 27.10.2023
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class WPSAF
  15. {
  16. private $delimeter_wp_safelink = 'wApbsCadfEeFlgiHnik';
  17.  
  18. public function __construct()
  19. {
  20. add_action('admin_menu', [$this, 'wp_safelink_menu']);
  21. add_filter('home_template', [$this, 'ch_register_page_template'], 999);
  22. add_filter('page_template', [$this, 'ch_register_page_template'], 999);
  23. add_filter('single_template', [$this, 'ch_register_page_template'], 999);
  24. add_shortcode('wpsafelink', [$this, 'wpsafcode']);
  25. add_action('init', [$this, 'custom_rewrite']);
  26. add_action('in_admin_footer', [$this, 'foot_admin'], 999);
  27. add_action('template_redirect', [$this, 'doRewrite']);
  28. }
  29.  
  30. public function custom_rewrite()
  31. {
  32. $wpsaf = json_decode(get_option('wpsaf_options'));
  33.  
  34. if ($wpsaf->permalink == 1) {
  35. add_rewrite_rule('^' . $wpsaf->permalink1 . '/(.*)?', 'index.php', 'top');
  36. flush_rewrite_rules();
  37. remove_filter('template_redirect', 'redirect_canonical');
  38. }
  39. }
  40.  
  41. public function wpsafcode($link)
  42. {
  43. $wpsaf = json_decode(get_option('wpsaf_options'));
  44. $link = array_map('trim', $link);
  45. $link = implode('', $link);
  46.  
  47. if ($link[0] == '=') {
  48. $link = substr($link, 1, 999);
  49. }
  50.  
  51. if ($wpsaf->permalink == 1) {
  52. $linkout = home_url() . '/' . $wpsaf->permalink1 . '/' . base64_encode($link);
  53. }
  54. else if ($wpsaf->permalink == 2) {
  55. $linkout = home_url() . '/?' . $wpsaf->permalink2 . '=' . base64_encode($link);
  56. }
  57. else {
  58. $linkout = home_url() . '/?' . base64_encode($link);
  59. }
  60.  
  61. return $linkout;
  62. }
  63.  
  64. public function wp_safelink_menu()
  65. {
  66. add_menu_page('WP Safelink', 'WP Safelink', 'manage_options', 'wp-safelink', [$this, 'wp_safelink_options'], '', '25');
  67. }
  68.  
  69. public function ch_register_page_template($page_template)
  70. {
  71. global $wpdb;
  72. $wpsaf = json_decode(get_option('wpsaf_options'));
  73. $urls = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  74. .....................................................................
  75. ........................................
  76. ..................
Add Comment
Please, Sign In to add comment