Guest User

Untitled

a guest
Jun 14th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 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.0.8.9
  8. * @ Author : DeZender
  9. * @ Release on : 10.05.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function adsw_autoload($className)
  15. {
  16. $className = ltrim($className, '\\');
  17. $fileName = '';
  18.  
  19. if ($lastNsPos = strrpos($className, '\\')) {
  20. $namespace = substr($className, 0, $lastNsPos);
  21. $className = substr($className, $lastNsPos + 1);
  22. $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
  23. }
  24.  
  25. $fileName .= $className . '.php';
  26. $file = ADSW_PATH . 'includes/' . $fileName;
  27.  
  28. if (file_exists($file)) {
  29. require $file;
  30. }
  31. }
  32.  
  33. function adsw_init_db()
  34. {
  35. global $wpdb;
  36. $wpdb->adsw_ali_meta = $wpdb->prefix . 'adsw_ali_meta';
  37. $wpdb->adsw_activities = $wpdb->prefix . 'adsw_activities';
  38. $wpdb->adsw_search_analytics = $wpdb->prefix . 'adsw_search_analytics';
  39. }
  40.  
  41. function adsw_check_version()
  42. {
  43. $foo = adsw_updparam();
  44. $plugin_slug = $foo['plugin_slug'];
  45. $plugin = $plugin_slug . '/' . $plugin_slug . '.php';
  46. $data = get_transient('adsw_plugin_info');
  47.  
  48. if (false === $data) {
  49. $checked_data = new stdClass();
  50. $checked_data->response = [];
  51. $checked_data->checked = [$plugin => ADSW_VERSION];
  52. $data = adsw_check_plugin_update($checked_data, true);
  53. $now = strtotime('now');
  54.  
  55. if (false === $upd = get_transient('update_plugins')) {
  56. $upd = new stdClass();
  57. $upd->last_checked = $now;
  58. $upd->checked[$plugin] = ADSW_VERSION;
  59.  
  60. if (is_object($data->response[$plugin])) {
  61. $upd->response[$plugin] = $data->response[$plugin];
  62. unset($upd->no_update[$plugin]);
  63. set_transient('update_plugins', $upd, 86400);
  64. }
  65. }
  66. else if (is_object($data->response[$plugin])) {
  67. $upd = new stdClass();
  68. $upd->last_checked = $now;
  69. $upd->checked = [$plugin => ADSW_VERSION];
  70. $upd->response = [$plugin => $data->response[$plugin]];
  71. $upd->translations = [];
  72. $upd->no_update = [];
  73. set_transient('update_plugins', $upd, 86400);
  74. }
  75.  
  76. set_transient('adsw_plugin_info', $data, 86400);
  77. return $data;
  78. }
  79.  
  80. return $data;
  81. }
  82.  
  83. function adsw_notice_update_plugin()
  84. {
  85. $foo = adsw_updparam();
  86. $plugin_slug = $foo['plugin_slug'];
  87. $plugin = $plugin_slug . '/' . $plugin_slug . '.php';
  88.  
  89. if (false === $data = get_transient('adsw_plugin_info')) {
  90. $data = adsw_check_version();
  91. }
  92.  
  93. $obj = $data->response[$plugin];
  94. if (is_object($obj) && version_compare($obj->version, ADSW_VERSION, '>')) {
  95. printf('<div class="notice notice-warning"><p>%s %s. <a href="%s">%s</a></p></div>', __('You use the outdated version of AliDropship Woo plugin. The latest version is', 'adsw'), $obj->version, wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $plugin), 'upgrade-plugin_' . $plugin), __('Update Now', 'adsw'));
  96. }
  97. }
  98.  
  99. function adsw_prepare_attr($attr)
  100. {
  101. if (!$attr || (count($attr) <= 0)) {
  102. return false;
  103. }
  104.  
  105. $foo = [];
  106.  
  107. foreach ($attr as $item) {
  108. $foo[] = ['name' => sanitize_text_field($item->attr_name), 'value' => sanitize_text_field($item->attr_value)];
  109. }
  110.  
  111. return $foo;
  112. }
  113.  
  114. function adsw_prepare_var_slug($str)
  115. {
  116. return substr(md5($str), 0, 22);
  117. }
  118.  
  119. function adsw_get_HtmlElement($html, $startOfElement, $endOfElement)
  120. {
  121. $startingPosition = strpos($html, $startOfElement);
  122. $endPosition = strpos($html, $endOfElement, $startingPosition);
  123. $foundElement = substr($html, $startingPosition, $endPosition);
  124. ...............................................................
  125. ..................................
  126. .................
Advertisement
Add Comment
Please, Sign In to add comment