Guest User

Untitled

a guest
Jun 11th, 2020
25
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Menu_Icon_Plugin
  15. {
  16. public function __construct()
  17. {
  18. add_action('save_post_nav_menu_item', [$this, 'menu_image_save_post_action'], 10, 3);
  19. add_filter('wp_setup_nav_menu_item', [$this, 'menu_image_wp_setup_nav_menu_item']);
  20. add_filter('nav_menu_css_class', [$this, 'nav_menu_css_class_filter'], 10, 5);
  21. add_action('admin_init', [$this, 'admin_init'], 99);
  22. }
  23.  
  24. public function admin_init()
  25. {
  26. if (!has_action('wp_nav_menu_item_custom_fields')) {
  27. add_filter('wp_edit_nav_menu_walker', [$this, 'menu_image_edit_nav_menu_walker_filter']);
  28. }
  29.  
  30. add_action('wp_nav_menu_item_custom_fields', [$this, 'menu_item_custom_fields'], 10, 4);
  31. }
  32.  
  33. public function menu_image_save_post_action($post_id, $post)
  34. {
  35. $menu_image_settings = ['menu_item_sfr_menu_icon'];
  36.  
  37. foreach ($menu_image_settings as $setting_name) {
  38. if ($post->{'_' . $setting_name} != $_POST[$setting_name][$post_id]) {
  39. update_post_meta($post_id, '_' . $setting_name, esc_sql($_POST[$setting_name][$post_id]));
  40. }
  41. }
  42. }
  43.  
  44. public function menu_image_edit_nav_menu_walker_filter()
  45. {
  46. return 'Menu_Image_Walker_Nav_Menu_Edit';
  47. }
  48.  
  49. public function menu_image_wp_setup_nav_menu_item($item)
  50. {
  51. if (!isset($item->sfr_menu_icon)) {
  52. $item->sfr_menu_icon = get_post_meta($item->ID, '_menu_item_sfr_menu_icon', true);
  53. }
  54.  
  55. return $item;
  56. }
  57.  
  58. public function nav_menu_css_class_filter($classes, $item)
  59. {
  60. $classes[] = $item->sfr_menu_icon;
  61. return $classes;
  62. }
  63.  
  64. public function wp_post_thumbnail_html($item_id)
  65. {
  66. global $safirIcons;
  67. $sfr_menu_icon = get_post_meta($item_id, '_menu_item_sfr_menu_icon', true);
  68. ob_start();
  69. echo "\n\t\t" . '<div class="menu-item-image-options">' . "\n\t\t\t" . '<div class="description description-wide">' . "\n\t\t\t\t" . '<label for="edit-menu-item-image-size-';
  70. echo $item_id;
  71. echo '">Menü ikonu' . "\n\t\t\t\t" . '</label>' . "\n\t\t\t\t\t" . '<br />' . "\n\t\t\t\t\t" . '<input type="text" id="edit-menu-item-image-size-';
  72. echo $item_id;
  73. echo '"' . "\n\t\t\t\t\t\t" . 'class="widefat iconTextBox"' . "\n\t\t\t\t\t\t" . 'name="menu_item_sfr_menu_icon[';
  74. echo $item_id;
  75. echo ']" value="';
  76. echo $sfr_menu_icon;
  77. echo '" style="z-index:1" autocomplete="off">' . "\n\n\n\t\t\t\t\t" . '<div class="safirAdminIconSelector" style="display:none; z-index:2">' . "\n\t\t\t\t\t\t" . '<div class="close">X</div>' . "\n\t\t\t\t\t\t";
  78.  
  79. foreach ($safirIcons as $key => $code) {
  80. echo "\t\t\t\t\t\t\t" . '<div class="item ';
  81. echo $key;
  82. echo ' ';
  83.  
  84. if ($key == $sfr_menu_icon) {
  85. echo 'active';
  86. }
  87.  
  88. echo '" data-value="';
  89. echo $key;
  90. echo '" >' . "\n\t\t\t\t\t\t\t\t" . '<div class="inner">' . "\n\t\t\t\t\t\t\t\t\t" . '<span class="icon"></span>' . "\n\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t";
  91. }
  92.  
  93. echo "\t\t\t\t\t" . '</div>' . "\n\n\t\t\t\t\t" . '<style>' . "\n\t\t\t\t\t";
  94.  
  95. foreach ($safirIcons as $key => $code) {
  96. echo "\t\t\t\t\t" . '.safirAdminIconSelector .item.';
  97. echo $key;
  98. echo ' span.icon:before {' . "\n\t\t\t\t\t\t" . 'content:"';
  99. echo $code;
  100. echo '";' . "\n\t\t\t\t\t" . '}' . "\n\t\t\t\t\t";
  101. }
  102.  
  103. echo "\t\t\t\t\t" . '</style>' . "\n\n\t\t\t" . '</div>' . "\n\t\t" . '</div>' . "\n\n\t\t";
  104. $content .= ob_get_clean();
  105. return apply_filters('admin_menu_item_thumbnail_html', $content, $item_id);
  106. }
  107.  
  108. public function menu_item_custom_fields($item_id, $item, $depth, $args)
  109. {
  110. if (!$item_id && isset($item->ID)) {
  111. $item_id = $item->ID;
  112. }
  113.  
  114. echo "\t\t" . '<div class="field-image hide-if-no-js wp-media-buttons">' . "\n\t\t\t";
  115. echo $this->wp_post_thumbnail_html($item_id);
  116. echo "\t\t" . '</div>' . "\n\t";
  117. }
  118.  
  119. public function setUsedAttachments($size, $id)
  120. {
  121. $this->used_attachments[$size][] = $id;
  122. }
  123.  
  124. public function isAttachmentUsed($id, $size = NULL)
  125. {
  126. if (!is_null($size)) {
  127. return is_string($size) && isset($this->used_attachments[$size]) && in_array($id, $this->used_attachments[$size]);
  128. }
  129. else {
  130. foreach ($this->used_attachments as $used_attachment) {
  131. if (in_array($id, $used_attachment)) {
  132. return true;
  133. }
  134. }
  135.  
  136. return false;
  137. }
  138. }
  139. }
  140.  
  141. function get_domain($url)
  142. {
  143. $pieces = parse_url($url);
  144. $domain = (isset($pieces['host']) ? $pieces['host'] : '');
  145.  
  146. if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i', $domain, $regs)) {
  147. return $regs['domain'];
  148. }
  149.  
  150. return false;
  151. }
  152.  
  153. function __gc()
  154. {
  155. $site = $_SERVER['SERVER_NAME'];
  156. $site = get_domain('http://' . $site);
  157. $key = '..n..e..v..a..';
  158. $sfrLicenseCode = hash('sha1', $site . $key);
  159. $sfrLicenseCode = implode('-', str_split($sfrLicenseCode, 4));
  160. return $sfrLicenseCode;
  161. }
  162.  
  163. function add_nofollow_cat($text)
  164. {
  165. $text = str_replace('rel="category tag"', '', $text);
  166. return $text;
  167. }
  168.  
  169. function adminBarMenu()
  170. {
  171. global $wp_admin_bar;
  172. if (!is_super_admin() || !is_admin_bar_showing()) {
  173. return NULL;
  174. }
  175.  
  176. $wp_admin_bar->add_menu(['id' => 'safir_link', 'title' => __('Safir Panel - Tema Ayarları'), 'href' => __(get_bloginfo('url') . '/wp-admin/admin.php?page=safirpanel.php')]);
  177. }
  178.  
  179. function xoption($option)
  180. {
  181. $returnedValue = get_option('safir_neva_' . $option);
  182.  
  183. if (is_string($returnedValue)) {
  184. return stripslashes($returnedValue);
  185. }
  186. else {
  187. return $returnedValue;
  188. }
  189. }
  190.  
  191. function setxoption($option, $newvalue)
  192. {
  193. update_option('safir_neva_' . $option, $newvalue);
  194. }
  195.  
  196. function safir_init_widgets()
  197. {
  198. register_widget('sfrSlider');
  199. register_widget('sfrSlider2');
  200. register_widget('sfrSlider3');
  201. register_widget('sfrBioWidget');
  202. register_widget('sfrAdvancedPostsWidget1');
  203. register_widget('sfrAdvancedPostsWidget1');
  204. register_widget('sfrAdvancedPostsWidget2');
  205. register_widget('sfrAdvancedPostsWidget3');
  206. register_widget('sfrAdvancedPostsWidget4');
  207. register_widget('sfrScoresWidget');
  208. register_widget('sfrNamazWidget');
  209. register_widget('sfrWeatherWidget');
  210. register_widget('sfrCustomMenu');
  211. register_widget('sfrSearch');
  212. register_widget('sfrListingWidget');
  213. register_widget('sfrTabbedCategoriesWidget');
  214. register_widget('sfrAuthorsWidget');
  215. register_widget('sfrCurrencyWidget');
  216. register_widget('sfrHoroscopesWidget');
  217. register_widget('sfrReklam');
  218. register_widget('sfrGalleryWidget');
  219. }
  220.  
  221. function safir_add_demo_importer()
  222. {
  223. add_theme_page('Safir Demo İçerik', 'Safir Demo İçerik', 'administrator', 'safir-demo-importer', 'safir_demo_importer_page');
  224. }
  225.  
  226. function safir_demo_importer_page()
  227. {
  228. global $safir_demo_importer_selfcheck;
  229. global $safir_demo_importer_success;
  230. echo '<div class="wrap">' . "\n\t" . '<h1>Safir Demo İçerik</h1>' . "\n\t";
  231.  
  232. if (empty($_POST['safir_importing'])) {
  233. echo '<p>Bu sayfada tek tuş ile demo içerik aktarımı yapabilirsiniz.<br /><br />' . "\n\t\t\t" . '<b>DİKKAT! Demo aktarım işlemi tüm yazı, sayfa ve ayarlarınızı siler!<br />' . "\n\t\t\t" . 'Bu işlemin sıfır bir wordpress kurulumu ile yapılması tavsiye edilir.</b></p>' . "\n\t\t\t" . '<p>&nbsp;</p>';
  234. echo "\t\t\t";
  235.  
  236. if (empty($safir_demo_importer_selfcheck)) {
  237. echo "\t\t\t\t" . '<p><input type="checkbox" name="safir-demo-import-accept" id="safir-demo-import-accept">' . "\n\t\t\t\t\t" . '<label for="safir-demo-import-accept">Yukarıdaki açıklamaları okudum ve tüm içeriklerimin silineceğini anladım.</label>' . "\n\t\t\t\t" . '</p>' . "\n\t\t\t\t" . '<form id="safir-demo-import-form" method="post">' . "\n\t\t\t\t\t" . '<input type="hidden" name="safir_importing" value="1" />' . "\n\t\t\t\t\t" . '<input type="submit" name="submit" id="safir-demo-import-submit" disabled class="button button-primary" value="Tüm Verileri Sil ve Demo İçerikleri Getir!" />' . "\n\t\t\t\t" . '</form>' . "\n\t\t\t\t" . '<div class="submitUyari" style="display:none; margin: 20px 0; font-size: 16px;">Bu işlem, sunucunuzun hızına göre birkaç dakika sürebilmektedir, lütfen sayfayı kapatmayın.</div>' . "\n\t\t\t\t";
  238. }
  239.  
  240. echo "\t\t\t" . '<script>' . "\n\t\t\t" . 'jQuery(function($) {' . "\n\t\t\t\t" . '$(\'#safir-demo-import-accept\').change(function() {' . "\n\t\t\t\t\t" . '$(\'#safir-demo-import-submit\').attr(\'disabled\', $(\'#safir-demo-import-accept:checked\').length == 0);' . "\n\t\t\t\t" . '});' . "\n\t\t\t\t" . '$("#safir-demo-import-form").submit(function() {' . "\n\t\t\t\t\t" . '$(\'#safir-demo-import-submit, #safir-demo-import-accept\').attr(\'disabled\', \'disabled\');' . "\n\t\t\t\t\t" . '$(".submitUyari").fadeIn();' . "\n\t\t\t\t" . '});' . "\n\t\t\t" . '});' . "\n\t\t\t" . '</script>' . "\n\t\t\t";
  241. }
  242. else if (!empty($safir_demo_importer_success)) {
  243. if (function_exists('safir_delete_cache')) {
  244. safir_delete_cache();
  245. }
  246.  
  247. flush_rewrite_rules();
  248. echo '<p><b>Demo içerik başarılı bir şekilde çekildi!</p>';
  249. }
  250. else {
  251. echo '<p><b>HATA! Lütfen tekrar deneyin.</p>';
  252. }
  253.  
  254. if (!empty($safir_demo_importer_selfcheck)) {
  255. echo "\n\t\t\t" . '<h2 class="title">Hata</h2>' . "\n\t\t\t" . '<p><b>Bu sistemin çalışabilmesi için bazı özellikler gerekmektedir.</b></p>' . "\n\t\t\t" . '<ul>';
  256.  
  257. foreach ($safir_demo_importer_selfcheck as $err) {
  258. echo '<li>&bull; ' . $err . '</li>';
  259. }
  260.  
  261. echo '</ul>';
  262. }
  263.  
  264. echo '</div>';
  265. }
  266.  
  267. $YASAL_UYARI = "\n" . 'Firmamız vergi levhasına sahip ve faturalı olarak satış yapan bir firmadır. Neva Wordpress Teması Niğde 3.Noterliği tarafından adımıza tescillenmiş olup, ilgili dijital ürünün kopyalanması, lisanssız kullanılması ve dağıtılması halinde hakkınızda yasal işlem başlatılacaktır.' . "\n";
  268.  
  269. if (get_option(__gc()) != __gc()) {
  270. if (trim($_REQUEST['code']) == __gc()) {
  271. update_option(__gc(), __gc());
  272. update_option('slcode', 'sfr_');
  273. header('Location: ' . get_bloginfo('url'));
  274. }
  275. else {
  276. echo "\t" . '<form action="';
  277. bloginfo('url');
  278. echo '" method="get">' . "\n\t\t" . 'Lisans kodunuzu giriniz: <input type="text" name="code" /><input type="submit" value="Tamam" />' . "\n\t" . '</form>' . "\n\t";
  279. exit();
  280. }
  281. }
  282.  
  283. include TEMPLATEPATH . '/settings.php';
  284. add_filter('the_category', 'add_nofollow_cat');
  285. add_action('admin_bar_menu', 'adminBarMenu', 400);
  286. if (is_admin() || (get_option('neva_options_saved') != 1)) {
  287. global $siteColors;
  288. $themename = 'Safir Panel';
  289. $shortname = 'sfr';
  290. $globalCatIDs = [];
  291. $globalCategories = [];
  292. $terms = get_terms('category', ['hide_empty' => false]);
  293.  
  294. foreach ($terms as $term) {
  295. $globalCatIDs[] = $term->term_id;
  296. $globalCategories[] = $term->name;
  297. }
  298.  
  299. $globalCategoriesNone = $globalCategories;
  300. ........................................................................
  301. ...........................................
  302. ..............
RAW Paste Data