Advertisement
Guest User

Untitled

a guest
Aug 5th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class WhmcsConnectRegist
  15. {
  16. public function __construct()
  17. {
  18. $val = (object) unserialize(get_option('WhcmsConnectSettings'));
  19.  
  20. if ($val->appendjs == 'header') {
  21. add_action('wp_enqueue_scripts', [$this, 'whcmsConnectJS']);
  22. }
  23. else {
  24. add_action('wp_footer', [$this, 'FooterwhcmsConnectJS']);
  25. }
  26.  
  27. add_action('admin_enqueue_scripts', [$this, 'whcmsConnectAdminScript']);
  28. add_action('admin_menu', [$this, 'whConnectSettingsPage']);
  29. add_action('WhcmsConnectCron', [$this, 'whcmsConnectProcced']);
  30. add_action('admin_init', [$this, 'whcmsConnectUpdater']);
  31. }
  32.  
  33. static public function whcmaConnectActionLinks($links)
  34. {
  35. $links[] = '<a href="' . admin_url('admin.php?page=') . WhmcsConnectSlug . '">' . __('Settings') . '</a>';
  36. $links[] = '<a href="' . admin_url('admin.php?page=' . WhmcsConnectLicenseSlug) . '">' . __('license') . '</a>';
  37. return $links;
  38. }
  39.  
  40. static public function WhcmsConnectCron()
  41. {
  42. if (!wp_next_scheduled(__FUNCTION__)) {
  43. wp_schedule_event(time(), 'daily', __FUNCTION__);
  44. }
  45. }
  46.  
  47. static public function DeleteWhcmsConnectCron()
  48. {
  49. wp_clear_scheduled_hook('WhcmsConnectCron');
  50. }
  51.  
  52. static public function whcmsConnectUpdater()
  53. {
  54. require_once WhmcsConnectPath . '/Inc/WhcmConUpdate.php';
  55. $updater = new Alledia\whcmsConnectUpdater(whcmsApiLink, WhcmsActivePage, ['version' => WhmcsConnectVersion, 'license' => get_option('whcmsConnect_license_key'), 'item_id' => whcmsConnectId, 'author' => WhmcsConnectAuther, 'beta' => false]);
  56. }
  57.  
  58. static public function whcmsConnectProcced()
  59. {
  60. global $wp_version;
  61. $license = trim(get_option('whcmsConnect_license_key'));
  62. $api_params = ['edd_action' => 'check_license', 'license' => $license, 'item_id' => whcmsConnectId, 'url' => home_url()];
  63. $response = wp_remote_post(whcmsApiLink, ['timeout' => 15, 'sslverify' => false, 'body' => $api_params]);
  64.  
  65. if (is_wp_error($response)) {
  66. return false;
  67. exit();
  68. }
  69.  
  70. $license_data = json_decode(wp_remote_retrieve_body($response));
  71.  
  72. if (!empty($license_data)) {
  73. if (isset($license_data->license) && ($license_data->license == 'valid')) {
  74. update_option('whcmsConnect_license_status', 'valid');
  75. return true;
  76. .......................................................................
  77. ...........................................
  78. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement