Changeset 2998356
- Timestamp:
- 11/19/2023 03:58:59 PM (2 years ago)
- Location:
- accordions-or-faqs
- Files:
-
- 156 added
- 19 edited
-
tags/2.3.5 (added)
-
tags/2.3.5/Classes (added)
-
tags/2.3.5/Classes/API.php (added)
-
tags/2.3.5/Classes/Bootstrap.php (added)
-
tags/2.3.5/Helper (added)
-
tags/2.3.5/Helper/Additional.php (added)
-
tags/2.3.5/Helper/Controls.php (added)
-
tags/2.3.5/Helper/Database.php (added)
-
tags/2.3.5/Helper/Helper.php (added)
-
tags/2.3.5/Helper/Installation.php (added)
-
tags/2.3.5/Helper/Post_Query.php (added)
-
tags/2.3.5/Helper/Sanitization.php (added)
-
tags/2.3.5/Helper/autoloader.php (added)
-
tags/2.3.5/Includes (added)
-
tags/2.3.5/Includes/Front_Page.php (added)
-
tags/2.3.5/Includes/Frontend.php (added)
-
tags/2.3.5/Includes/Settings.php (added)
-
tags/2.3.5/Includes/Shortcode.php (added)
-
tags/2.3.5/Includes/Templates.php (added)
-
tags/2.3.5/Includes/Widget.php (added)
-
tags/2.3.5/Layouts (added)
-
tags/2.3.5/Layouts/Admin.php (added)
-
tags/2.3.5/Layouts/Helper.php (added)
-
tags/2.3.5/Layouts/Template.php (added)
-
tags/2.3.5/Oxilab (added)
-
tags/2.3.5/Oxilab/Plugins.php (added)
-
tags/2.3.5/Oxilab/Recommend.php (added)
-
tags/2.3.5/Oxilab/Reviews.php (added)
-
tags/2.3.5/Oxilab/Welcome.php (added)
-
tags/2.3.5/Oxilab/css (added)
-
tags/2.3.5/Oxilab/css/notice.css (added)
-
tags/2.3.5/Oxilab/js (added)
-
tags/2.3.5/Oxilab/js/notice.js (added)
-
tags/2.3.5/Oxilab/js/recommend.js (added)
-
tags/2.3.5/assets (added)
-
tags/2.3.5/assets/backend (added)
-
tags/2.3.5/assets/backend/css (added)
-
tags/2.3.5/assets/backend/css/admin-welcome.css (added)
-
tags/2.3.5/assets/backend/css/admin.css (added)
-
tags/2.3.5/assets/backend/css/bootstrap.min.css (added)
-
tags/2.3.5/assets/backend/css/bootstrap.min.css.map (added)
-
tags/2.3.5/assets/backend/css/fontawesome-iconpicker.css (added)
-
tags/2.3.5/assets/backend/css/icon-close-black.png (added)
-
tags/2.3.5/assets/backend/css/icon-close-white.png (added)
-
tags/2.3.5/assets/backend/css/img (added)
-
tags/2.3.5/assets/backend/css/img/trans_bg.png (added)
-
tags/2.3.5/assets/backend/css/jquery.coloring-pick.min.js.css (added)
-
tags/2.3.5/assets/backend/css/jquery.fontselect.css (added)
-
tags/2.3.5/assets/backend/css/minicolors.css (added)
-
tags/2.3.5/assets/backend/css/notice.css (added)
-
tags/2.3.5/assets/backend/css/nouislider.css (added)
-
tags/2.3.5/assets/backend/css/select2.min.css (added)
-
tags/2.3.5/assets/backend/css/template.css (added)
-
tags/2.3.5/assets/backend/custom (added)
-
tags/2.3.5/assets/backend/custom/editor.js (added)
-
tags/2.3.5/assets/backend/custom/front-page.js (added)
-
tags/2.3.5/assets/backend/custom/frontend.js (added)
-
tags/2.3.5/assets/backend/custom/media-uploader.js (added)
-
tags/2.3.5/assets/backend/custom/settings.js (added)
-
tags/2.3.5/assets/backend/custom/template.js (added)
-
tags/2.3.5/assets/backend/img (added)
-
tags/2.3.5/assets/backend/img/icons (added)
-
tags/2.3.5/assets/backend/img/icons/angle-2.png (added)
-
tags/2.3.5/assets/backend/img/icons/angle-3.png (added)
-
tags/2.3.5/assets/backend/img/icons/angle-double-down.png (added)
-
tags/2.3.5/assets/backend/img/icons/angle-double-up.png (added)
-
tags/2.3.5/assets/backend/img/icons/angle-double.png (added)
-
tags/2.3.5/assets/backend/img/icons/angle.png (added)
-
tags/2.3.5/assets/backend/img/icons/arrow-up.png (added)
-
tags/2.3.5/assets/backend/img/icons/arrow.png (added)
-
tags/2.3.5/assets/backend/img/icons/carret-up.png (added)
-
tags/2.3.5/assets/backend/img/icons/carret.png (added)
-
tags/2.3.5/assets/backend/img/icons/chevron.png (added)
-
tags/2.3.5/assets/backend/img/icons/custom.png (added)
-
tags/2.3.5/assets/backend/img/icons/demo.png (added)
-
tags/2.3.5/assets/backend/img/icons/hand.png (added)
-
tags/2.3.5/assets/backend/img/icons/plus.png (added)
-
tags/2.3.5/assets/backend/img/icons/tick.png (added)
-
tags/2.3.5/assets/backend/js (added)
-
tags/2.3.5/assets/backend/js/bootstrap.min.js (added)
-
tags/2.3.5/assets/backend/js/bootstrap.min.js.map (added)
-
tags/2.3.5/assets/backend/js/dataTables.bootstrap.min.js (added)
-
tags/2.3.5/assets/backend/js/fontawesome-iconpicker.js (added)
-
tags/2.3.5/assets/backend/js/img (added)
-
tags/2.3.5/assets/backend/js/img/jquery.minicolors.png (added)
-
tags/2.3.5/assets/backend/js/img/trans_bg.png (added)
-
tags/2.3.5/assets/backend/js/jquery.coloring-pick.min.js (added)
-
tags/2.3.5/assets/backend/js/jquery.conditionize2.min.js (added)
-
tags/2.3.5/assets/backend/js/jquery.dataTables.min.js (added)
-
tags/2.3.5/assets/backend/js/jquery.minicolors.js (added)
-
tags/2.3.5/assets/backend/js/jquery.serializejson.min.js (added)
-
tags/2.3.5/assets/backend/js/minicolors.js (added)
-
tags/2.3.5/assets/backend/js/nouislider.js (added)
-
tags/2.3.5/assets/backend/js/popper.min.js (added)
-
tags/2.3.5/assets/backend/js/select2.min.js (added)
-
tags/2.3.5/assets/export (added)
-
tags/2.3.5/assets/export/index.php (added)
-
tags/2.3.5/assets/frontend (added)
-
tags/2.3.5/assets/frontend/css (added)
-
tags/2.3.5/assets/frontend/css/animate.css (added)
-
tags/2.3.5/assets/frontend/css/font-awsome.min.css (added)
-
tags/2.3.5/assets/frontend/css/style.css (added)
-
tags/2.3.5/assets/frontend/css/template-1.css (added)
-
tags/2.3.5/assets/frontend/js (added)
-
tags/2.3.5/assets/frontend/js/accordions.js (added)
-
tags/2.3.5/assets/frontend/js/collapse.js (added)
-
tags/2.3.5/assets/frontend/webfonts (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-brands-400.eot (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-brands-400.svg (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-brands-400.ttf (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-brands-400.woff (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-brands-400.woff2 (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-regular-400.eot (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-regular-400.svg (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-regular-400.ttf (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-regular-400.woff (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-regular-400.woff2 (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-solid-900.eot (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-solid-900.svg (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-solid-900.ttf (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-solid-900.woff (added)
-
tags/2.3.5/assets/frontend/webfonts/fa-solid-900.woff2 (added)
-
tags/2.3.5/assets/image (added)
-
tags/2.3.5/assets/image/logo.png (added)
-
tags/2.3.5/assets/image/sa-logo.png (added)
-
tags/2.3.5/demo-template (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-1.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-10.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-11.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-12.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-13.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-14.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-15.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-16.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-17.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-18.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-19.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-2.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-20.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-21.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-22.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-23.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-24.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-25.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-26.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-27.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-28.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-3.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-4.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-5.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-6.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-7.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-8.json (added)
-
tags/2.3.5/demo-template/accordions-or-faqs-template-9.json (added)
-
tags/2.3.5/index.php (added)
-
tags/2.3.5/readme.txt (added)
-
trunk/Classes/API.php (modified) (3 diffs)
-
trunk/Helper/Additional.php (modified) (4 diffs)
-
trunk/Helper/Database.php (modified) (4 diffs)
-
trunk/Helper/Helper.php (modified) (2 diffs)
-
trunk/Helper/Installation.php (modified) (2 diffs)
-
trunk/Helper/Post_Query.php (modified) (4 diffs)
-
trunk/Includes/Front_Page.php (modified) (2 diffs)
-
trunk/Includes/Frontend.php (modified) (2 diffs)
-
trunk/Includes/Settings.php (modified) (5 diffs)
-
trunk/Includes/Shortcode.php (modified) (4 diffs)
-
trunk/Layouts/Admin.php (modified) (4 diffs)
-
trunk/Layouts/Helper.php (modified) (2 diffs)
-
trunk/Layouts/Template.php (modified) (4 diffs)
-
trunk/Oxilab/Plugins.php (modified) (2 diffs)
-
trunk/Oxilab/Recommend.php (modified) (2 diffs)
-
trunk/Oxilab/Reviews.php (modified) (2 diffs)
-
trunk/Oxilab/Welcome.php (modified) (2 diffs)
-
trunk/index.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
accordions-or-faqs/trunk/Classes/API.php
r2959347 r2998356 29 29 30 30 31 public function validate_post($data = '') 32 { 33 $rawdata = []; 34 if (!empty($data)) : 35 $arrfiles = json_decode(stripslashes($data), true); 36 else : 37 $data = $this->rawdata; 38 $arrfiles = json_decode(stripslashes($this->rawdata), true); 39 endif; 40 if (is_array($arrfiles)) : 41 $rawdata = array_map([$this, 'allowed_html'], $arrfiles); 42 else : 43 $rawdata = $this->allowed_html($data); 44 endif; 45 return $rawdata; 31 public function post_create_new_accordions() 32 { 33 $params = $this->validate_post(); 34 $folder = $this->safe_path(OXI_ACCORDIONS_PATH . 'demo-template/'); 35 $filename = sanitize_text_field($params['template-id']); 36 $name = sanitize_text_field($params['addons-style-name']); 37 $data = json_decode(file_get_contents($folder . $filename), true); 38 39 if (empty($data)) { 40 return new WP_Error('file_error', 'Invalid File'); 41 } 42 43 $content = $data['style']; 44 45 if (!is_array($content) || $content['type'] != 'accordions-or-faqs') { 46 return new WP_Error('file_error', 'Invalid Content In File'); 47 } 48 49 return $this->post_json_import($data, $name); 50 } 51 52 /** 53 * Generate safe path 54 * @since v1.0.0 55 */ 56 public function safe_path($path) 57 { 58 59 $path = str_replace(['//', '\\\\'], ['/', '\\'], $path); 60 return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path); 61 } 62 63 public function post_json_import($params, $name = 'truee') 64 { 65 66 if (!is_array($params) || $params['style']['type'] != 'accordions-or-faqs') { 67 return new WP_Error('file_error', 'Invalid Content In File'); 68 } 69 $style = $params['style']; 70 $child = $params['child']; 71 if ($name != 'truee') : 72 $style['name'] = $name; 73 endif; 74 75 $raw = json_decode(stripslashes($style['rawdata']), true); 76 $custom = strtolower($raw['oxi-accordions-custom-css']); 77 if (preg_match('/style/i', $custom) || preg_match('/script/i', $custom)) { 78 return 'Don\'t be smart, Kindly add validated data.'; 79 } 80 81 82 $this->database->wpdb->query($this->database->wpdb->prepare("INSERT INTO {$this->database->parent_table} (name, type, rawdata) VALUES ( %s, %s, %s)", [$style['name'], 'accordions-or-faqs', $style['rawdata']])); 83 $redirect_id = $this->database->wpdb->insert_id; 84 85 if ($redirect_id > 0) : 86 $raw['style-id'] = $redirect_id; 87 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Layouts\Helper'; 88 $CLASS = new $CLASS('admin'); 89 $CLASS->template_css_render($raw); 90 foreach ($child as $value) { 91 $this->database->wpdb->query($this->database->wpdb->prepare("INSERT INTO {$this->database->child_table} (styleid, rawdata) VALUES (%d, %s)", [$redirect_id, $value['rawdata']])); 92 } 93 return admin_url("admin.php?page=oxi-accordions-ultimate-new&styleid=$redirect_id"); 94 endif; 95 } 96 97 /** 98 * Constructor of plugin class 99 * 100 * @since 2.0.1 101 */ 102 public function __construct() 103 { 104 $this->database = new Database(); 105 add_action('wp_ajax_oxi_accordions_ultimate', [$this, 'save_action']); 106 } 107 108 public function save_action() 109 { 110 if (!$this->get_permissions_check()) { 111 return new WP_REST_Request('Invalid URL', 422); 112 die(); 113 } 114 $wpnonce = sanitize_key(wp_unslash($_REQUEST['_wpnonce'])); 115 if (!wp_verify_nonce($wpnonce, 'oxi_accordions_ultimate')) : 116 return new WP_REST_Request('Invalid URL', 422); 117 die(); 118 endif; 119 120 $functionname = isset($_REQUEST['functionname']) ? sanitize_text_field($_REQUEST['functionname']) : ''; 121 $this->rawdata = isset($_REQUEST['rawdata']) ? sanitize_post($_REQUEST['rawdata']) : ''; 122 $this->styleid = isset($_REQUEST['styleid']) ? (int) $_REQUEST['styleid'] : ''; 123 $this->childid = isset($_REQUEST['childid']) ? (int) $_REQUEST['childid'] : ''; 124 $action_class = 'post_' . sanitize_key($functionname); 125 if (method_exists($this, $action_class)) { 126 echo $this->{$action_class}(); 127 } 128 die(); 129 } 130 public function post_shortcode_delete() 131 { 132 $styleid = (int) $this->styleid; 133 if ($styleid) : 134 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->parent_table} WHERE id = %d", $styleid)); 135 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->child_table} WHERE styleid = %d", $styleid)); 136 return 'done'; 137 else : 138 return 'Silence is Golden'; 139 endif; 140 } 141 142 public function post_shortcode_deactive() 143 { 144 $params = $this->validate_post(); 145 $id = (int) $params['oxideletestyle']; 146 if ($id > 0) : 147 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->import_table} WHERE name = %s and type = %s", $id, 'accordions-or-faqs')); 148 return 'done'; 149 else : 150 return 'Silence is Golden'; 151 endif; 46 152 } 47 153 … … 486 592 return 'success'; 487 593 } 488 594 public function validate_post($data = '') 595 { 596 $rawdata = []; 597 if (!empty($data)) : 598 $arrfiles = json_decode(stripslashes($data), true); 599 else : 600 $data = $this->rawdata; 601 $arrfiles = json_decode(stripslashes($this->rawdata), true); 602 endif; 603 if (is_array($arrfiles)) : 604 $rawdata = array_map([$this, 'allowed_html'], $arrfiles); 605 else : 606 $rawdata = $this->allowed_html($data); 607 endif; 608 return $rawdata; 609 } 489 610 public function activate_license($key) 490 611 { … … 568 689 } 569 690 570 public function post_create_new_accordions() 571 { 572 $params = $this->validate_post(); 573 $folder = $this->safe_path(OXI_ACCORDIONS_PATH . 'demo-template/'); 574 $filename = sanitize_text_field($params['template-id']); 575 $name = sanitize_text_field($params['addons-style-name']); 576 $data = json_decode(file_get_contents($folder . $filename), true); 577 578 if (empty($data)) { 579 return new WP_Error('file_error', 'Invalid File'); 580 } 581 582 $content = $data['style']; 583 584 if (!is_array($content) || $content['type'] != 'accordions-or-faqs') { 585 return new WP_Error('file_error', 'Invalid Content In File'); 586 } 587 588 return $this->post_json_import($data, $name); 589 } 590 591 /** 592 * Generate safe path 593 * @since v1.0.0 594 */ 595 public function safe_path($path) 596 { 597 598 $path = str_replace(['//', '\\\\'], ['/', '\\'], $path); 599 return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path); 600 } 601 602 public function post_json_import($params, $name = 'truee') 603 { 604 605 if (!is_array($params) || $params['style']['type'] != 'accordions-or-faqs') { 606 return new WP_Error('file_error', 'Invalid Content In File'); 607 } 608 $style = $params['style']; 609 $child = $params['child']; 610 if ($name != 'truee') : 611 $style['name'] = $name; 612 endif; 613 614 $raw = json_decode(stripslashes($style['rawdata']), true); 615 $custom = strtolower($raw['oxi-accordions-custom-css']); 616 if (preg_match('/style/i', $custom) || preg_match('/script/i', $custom)) { 617 return 'Don\'t be smart, Kindly add validated data.'; 618 } 619 620 621 $this->database->wpdb->query($this->database->wpdb->prepare("INSERT INTO {$this->database->parent_table} (name, type, rawdata) VALUES ( %s, %s, %s)", [$style['name'], 'accordions-or-faqs', $style['rawdata']])); 622 $redirect_id = $this->database->wpdb->insert_id; 623 624 if ($redirect_id > 0) : 625 $raw['style-id'] = $redirect_id; 626 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Layouts\Helper'; 627 $CLASS = new $CLASS('admin'); 628 $CLASS->template_css_render($raw); 629 foreach ($child as $value) { 630 $this->database->wpdb->query($this->database->wpdb->prepare("INSERT INTO {$this->database->child_table} (styleid, rawdata) VALUES (%d, %s)", [$redirect_id, $value['rawdata']])); 631 } 632 return admin_url("admin.php?page=oxi-accordions-ultimate-new&styleid=$redirect_id"); 633 endif; 634 } 635 636 /** 637 * Constructor of plugin class 638 * 639 * @since 2.0.1 640 */ 641 public function __construct() 642 { 643 $this->database = new Database(); 644 add_action('wp_ajax_oxi_accordions_ultimate', [$this, 'save_action']); 645 } 646 647 public function save_action() 648 { 649 if (!$this->get_permissions_check()) { 650 return new WP_REST_Request('Invalid URL', 422); 651 die(); 652 } 653 $wpnonce = sanitize_key(wp_unslash($_REQUEST['_wpnonce'])); 654 if (!wp_verify_nonce($wpnonce, 'oxi_accordions_ultimate')) : 655 return new WP_REST_Request('Invalid URL', 422); 656 die(); 657 endif; 658 659 $functionname = isset($_REQUEST['functionname']) ? sanitize_text_field($_REQUEST['functionname']) : ''; 660 $this->rawdata = isset($_REQUEST['rawdata']) ? sanitize_post($_REQUEST['rawdata']) : ''; 661 $this->styleid = isset($_REQUEST['styleid']) ? (int) $_REQUEST['styleid'] : ''; 662 $this->childid = isset($_REQUEST['childid']) ? (int) $_REQUEST['childid'] : ''; 663 $action_class = 'post_' . sanitize_key($functionname); 664 if (method_exists($this, $action_class)) { 665 echo $this->{$action_class}(); 666 } 667 die(); 668 } 669 public function post_shortcode_delete() 670 { 671 $styleid = (int) $this->styleid; 672 if ($styleid) : 673 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->parent_table} WHERE id = %d", $styleid)); 674 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->child_table} WHERE styleid = %d", $styleid)); 675 return 'done'; 676 else : 677 return 'Silence is Golden'; 678 endif; 679 } 680 681 public function post_shortcode_deactive() 682 { 683 $params = $this->validate_post(); 684 $id = (int) $params['oxideletestyle']; 685 if ($id > 0) : 686 $this->database->wpdb->query($this->database->wpdb->prepare("DELETE FROM {$this->database->import_table} WHERE name = %s and type = %s", $id, 'accordions-or-faqs')); 687 return 'done'; 688 else : 689 return 'Silence is Golden'; 690 endif; 691 } 691 692 692 693 693 public function get_permissions_check() -
accordions-or-faqs/trunk/Helper/Additional.php
r2959347 r2998356 29 29 } 30 30 31 32 33 public function admin_template_additional() 31 public function admin_front_additional() 34 32 { 35 33 $this->admin_css(); … … 43 41 wp_enqueue_script('jquery-ui-slider'); 44 42 wp_enqueue_script('jquery-ui-draggable'); 45 wp_enqueue_script('oxi-accordions-front-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/template.js', false, 'accordions-or-faqs'); 46 } 43 wp_enqueue_script('jquery.dataTables.min', OXI_ACCORDIONS_URL . 'assets/backend/js/jquery.dataTables.min.js', false, OXI_ACCORDIONS_PLUGIN_VERSION); 44 wp_enqueue_script('dataTables.bootstrap.min', OXI_ACCORDIONS_URL . 'assets/backend/js/dataTables.bootstrap.min.js', false, OXI_ACCORDIONS_PLUGIN_VERSION); 45 wp_enqueue_script('oxi-accordions-front-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/front-page.js', false, 'accordions-or-faqs'); 46 } 47 47 48 48 49 public function import_font_family() … … 425 426 $this->admin_media_scripts(); 426 427 } 428 429 public function admin_template_additional() 430 { 431 $this->admin_css(); 432 $this->admin_jquery(); 433 wp_enqueue_script("jquery"); 434 wp_enqueue_script('jquery-ui-core'); 435 wp_enqueue_script('jquery-ui-widget'); 436 wp_enqueue_script('jquery-ui-mouse'); 437 wp_enqueue_script('jquery-ui-accordion'); 438 wp_enqueue_script('jquery-ui-autocomplete'); 439 wp_enqueue_script('jquery-ui-slider'); 440 wp_enqueue_script('jquery-ui-draggable'); 441 wp_enqueue_script('oxi-accordions-front-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/template.js', false, 'accordions-or-faqs'); 442 } 427 443 public function admin_settings_additional() 428 444 { … … 441 457 } 442 458 443 public function admin_front_additional() 444 { 445 $this->admin_css(); 446 $this->admin_jquery(); 447 wp_enqueue_script("jquery"); 448 wp_enqueue_script('jquery-ui-core'); 449 wp_enqueue_script('jquery-ui-widget'); 450 wp_enqueue_script('jquery-ui-mouse'); 451 wp_enqueue_script('jquery-ui-accordion'); 452 wp_enqueue_script('jquery-ui-autocomplete'); 453 wp_enqueue_script('jquery-ui-slider'); 454 wp_enqueue_script('jquery-ui-draggable'); 455 wp_enqueue_script('jquery.dataTables.min', OXI_ACCORDIONS_URL . 'assets/backend/js/jquery.dataTables.min.js', false, OXI_ACCORDIONS_PLUGIN_VERSION); 456 wp_enqueue_script('dataTables.bootstrap.min', OXI_ACCORDIONS_URL . 'assets/backend/js/dataTables.bootstrap.min.js', false, OXI_ACCORDIONS_PLUGIN_VERSION); 457 wp_enqueue_script('oxi-accordions-front-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/front-page.js', false, 'accordions-or-faqs'); 458 } 459 459 460 public function loader_font_familly_validation($data = []) 460 461 { -
accordions-or-faqs/trunk/Helper/Database.php
r2922783 r2998356 10 10 * author @biplob018 11 11 */ 12 Class Database { 12 class Database 13 { 13 14 14 15 /** … … 41 42 protected static $lfe_instance = NULL; 42 43 43 public function allowed_tags() { 44 public function update_database() 45 { 46 $charset_collate = $this->wpdb->get_charset_collate(); 47 48 $sql1 = "CREATE TABLE $this->parent_table ( 49 id mediumint(5) NOT NULL AUTO_INCREMENT, 50 name varchar(50) NOT NULL, 51 type varchar(50) NOT NULL, 52 style_name varchar(40), 53 rawdata longtext, 54 stylesheet longtext, 55 font_family text, 56 PRIMARY KEY (id) 57 ) $charset_collate;"; 58 59 $sql2 = "CREATE TABLE $this->child_table ( 60 id mediumint(5) NOT NULL AUTO_INCREMENT, 61 styleid mediumint(6) NOT NULL, 62 type varchar(50) NOT NULL, 63 rawdata text, 64 stylesheet text, 65 PRIMARY KEY (id) 66 ) $charset_collate;"; 67 68 $sql3 = "CREATE TABLE $this->import_table ( 69 id mediumint(5) NOT NULL AUTO_INCREMENT, 70 type varchar(50) NULL, 71 name varchar(100) NULL, 72 font varchar(200) NULL, 73 PRIMARY KEY (id) 74 ) $charset_collate;"; 75 76 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 77 dbDelta($sql1); 78 dbDelta($sql2); 79 dbDelta($sql3); 80 } 81 public function allowed_tags() 82 { 44 83 45 84 $allowed_tags = array( … … 157 196 } 158 197 159 public function update_database() {160 $charset_collate = $this->wpdb->get_charset_collate();161 162 $sql1 = "CREATE TABLE $this->parent_table (163 id mediumint(5) NOT NULL AUTO_INCREMENT,164 name varchar(50) NOT NULL,165 type varchar(50) NOT NULL,166 style_name varchar(40),167 rawdata longtext,168 stylesheet longtext,169 font_family text,170 PRIMARY KEY (id)171 ) $charset_collate;";172 173 $sql2 = "CREATE TABLE $this->child_table (174 id mediumint(5) NOT NULL AUTO_INCREMENT,175 styleid mediumint(6) NOT NULL,176 type varchar(50) NOT NULL,177 rawdata text,178 stylesheet text,179 PRIMARY KEY (id)180 ) $charset_collate;";181 182 $sql3 = "CREATE TABLE $this->import_table (183 id mediumint(5) NOT NULL AUTO_INCREMENT,184 type varchar(50) NULL,185 name varchar(100) NULL,186 font varchar(200) NULL,187 PRIMARY KEY (id)188 ) $charset_collate;";189 190 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );191 dbDelta($sql1);192 dbDelta($sql2);193 dbDelta($sql3);194 }195 198 196 199 /** 197 200 * Access plugin instance. You can create further instances by calling 198 201 */ 199 public static function get_instance() { 202 public static function get_instance() 203 { 200 204 if (NULL === self::$lfe_instance) 201 205 self::$lfe_instance = new self; … … 204 208 } 205 209 206 public function __construct() { 210 public function __construct() 211 { 207 212 global $wpdb; 208 213 $this->wpdb = $wpdb; -
accordions-or-faqs/trunk/Helper/Helper.php
r2959347 r2998356 44 44 } 45 45 46 public function accordions_shortcode($atts) 47 { 48 extract(shortcode_atts(['id' => ' ',], $atts)); 49 $styleid = $atts['id']; 50 ob_start(); 51 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Includes\Shortcode'; 52 if (class_exists($CLASS)) : 53 new $CLASS($styleid, 'user'); 54 endif; 55 return ob_get_clean(); 56 } 57 58 public function shortcode_render($id, $user) 59 { 60 return; 61 } 62 63 /** 64 * Plugin check Current Accordions 65 * 66 * @since 2.0.1 67 */ 68 public function check_current_accordions($agr) 69 { 70 $vs = get_option($this->fixed_data('6163636f7264696f6e735f6f725f666171735f6c6963656e73655f737461747573')); 71 if ($vs == $this->fixed_data('76616c6964')) { 72 return true; 73 } else { 74 return false; 75 } 76 } 46 77 47 78 48 /** … … 155 125 new \OXI_ACCORDIONS_PLUGINS\Includes\Settings(); 156 126 } 157 127 public function accordions_shortcode($atts) 128 { 129 extract(shortcode_atts(['id' => ' ',], $atts)); 130 $styleid = $atts['id']; 131 ob_start(); 132 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Includes\Shortcode'; 133 if (class_exists($CLASS)) : 134 new $CLASS($styleid, 'user'); 135 endif; 136 return ob_get_clean(); 137 } 138 139 public function shortcode_render($id, $user) 140 { 141 return; 142 } 143 144 /** 145 * Plugin check Current Accordions 146 * 147 * @since 2.0.1 148 */ 149 public function check_current_accordions($agr) 150 { 151 $vs = get_option($this->fixed_data('6163636f7264696f6e735f6f725f666171735f6c6963656e73655f737461747573')); 152 if ($vs == $this->fixed_data('76616c6964')) { 153 return true; 154 } else { 155 return false; 156 } 157 } 158 158 public function oxilab_plugins() 159 159 { -
accordions-or-faqs/trunk/Helper/Installation.php
r2959347 r2998356 25 25 return hex2bin($agr); 26 26 } 27 28 /**29 * Plugin fixed debugging data30 *31 * @since 2.0.132 */33 public function fixed_debug_data($str)34 {35 return bin2hex($str);36 }37 38 /**39 * Access plugin instance. You can create further instances by calling40 */41 public static function get_instance()42 {43 if (NULL === self::$lfe_instance)44 self::$lfe_instance = new self;45 46 return self::$lfe_instance;47 }48 49 27 public function __construct() 50 28 { … … 72 50 set_transient('accordions_or_faqs_activation_redirect', true, 30); 73 51 } 52 /** 53 * Plugin fixed debugging data 54 * 55 * @since 2.0.1 56 */ 57 public function fixed_debug_data($str) 58 { 59 return bin2hex($str); 60 } 61 62 /** 63 * Access plugin instance. You can create further instances by calling 64 */ 65 public static function get_instance() 66 { 67 if (NULL === self::$lfe_instance) 68 self::$lfe_instance = new self; 69 70 return self::$lfe_instance; 71 } 74 72 } -
accordions-or-faqs/trunk/Helper/Post_Query.php
r2959347 r2998356 24 24 } 25 25 26 public function post_category($type)27 {28 $cat = [];29 $categories = get_terms(array(30 'taxonomy' => $type == 'post' ? 'category' : $type . '_category',31 'hide_empty' => true,32 ));33 if (empty($categories) || is_wp_error($categories)) :34 return [];35 endif;36 26 37 foreach ($categories as $categorie) {38 $cat[$categorie->term_id] = ucfirst($categorie->name);39 }40 return $cat;41 }42 27 43 28 public function post_type() … … 63 48 return $tg; 64 49 } 50 public function post_include($type) 51 { 52 $post_list = get_posts(array( 53 'post_type' => $type, 54 'orderby' => 'date', 55 'order' => 'DESC', 56 'posts_per_page' => -1, 57 )); 58 if (empty($post_list) && is_wp_error($post_list)) : 59 return []; 60 endif; 61 $posts = array(); 62 foreach ($post_list as $post) { 63 $posts[$post->ID] = ucfirst($post->post_title); 64 } 65 return $posts; 66 } 65 67 public function post_exclude($type) 66 68 { … … 80 82 return $posts; 81 83 } 84 public function post_category($type) 85 { 86 $cat = []; 87 $categories = get_terms(array( 88 'taxonomy' => $type == 'post' ? 'category' : $type . '_category', 89 'hide_empty' => true, 90 )); 91 if (empty($categories) || is_wp_error($categories)) : 92 return []; 93 endif; 82 94 95 foreach ($categories as $categorie) { 96 $cat[$categorie->term_id] = ucfirst($categorie->name); 97 } 98 return $cat; 99 } 83 100 public function thumbnail_sizes() 84 101 { … … 91 108 return $thumbnail_sizes; 92 109 } 93 public function post_include($type)94 {95 $post_list = get_posts(array(96 'post_type' => $type,97 'orderby' => 'date',98 'order' => 'DESC',99 'posts_per_page' => -1,100 ));101 if (empty($post_list) && is_wp_error($post_list)) :102 return [];103 endif;104 $posts = array();105 foreach ($post_list as $post) {106 $posts[$post->ID] = ucfirst($post->post_title);107 }108 return $posts;109 }110 110 } -
accordions-or-faqs/trunk/Includes/Front_Page.php
r2959347 r2998356 38 38 } 39 39 40 /**41 * Plugin Name Convert to View42 *43 * @since 2.0.144 */45 public function name_converter($data)46 {47 $data = str_replace('tyle', 'tyle ', $data);48 return ucwords($data);49 }50 51 public function create_new()52 {53 echo '<div class="oxi-addons-row">54 <div class="oxi-addons-col-1 oxi-import">55 <div class="oxi-addons-style-preview">56 <div class="oxilab-admin-style-preview-top">57 <a href="#" id="oxilab-accordions-import-json">58 <div class="oxilab-admin-add-new-item">59 <span>60 <i class="fas fa-plus-circle oxi-icons"></i>61 Import Accordions62 </span>63 </div>64 </a>65 </div>66 </div>67 </div>68 </div>';69 70 echo '<div class="modal fade" id="oxi-addons-style-create-modal" >71 <form method="post" id="oxi-addons-style-modal-form">72 <div class="modal-dialog modal-sm modal-dialog-centered">73 <div class="modal-content">74 <div class="modal-header">75 <h4 class="modal-title">Tabs Clone</h4>76 <button type="button" class="close" data-dismiss="modal">×</button>77 </div>78 <div class="modal-body">79 <div class=" form-group row">80 <label for="addons-style-name" class="col-sm-6 col-form-label" oxi-addons-tooltip="Give your Shortcode Name Here">Name</label>81 <div class="col-sm-6 addons-dtm-laptop-lock">82 <input class="form-control" type="text" value="" id="addons-style-name" name="addons-style-name" required>83 </div>84 </div>85 </div>86 <div class="modal-footer">87 88 <input type="hidden" id="oxistyleid" name="oxistyleid" value="">89 <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>90 <input type="submit" class="btn btn-success" name="addonsdatasubmit" id="addonsdatasubmit" value="Save">91 </div>92 </div>93 </div>94 </form>95 </div>96 ';97 echo '<div class="modal fade" id="oxi-addons-style-import-modal" >98 <form method="post" id="oxi-addons-import-modal-form" enctype="multipart/form-data">99 <div class="modal-dialog modal-sm modal-dialog-centered">100 <div class="modal-content">101 <div class="modal-header">102 <h4 class="modal-title">Import Form</h4>103 <button type="button" class="close" data-dismiss="modal">×</button>104 </div>105 <div class="modal-body">106 <input class="form-control" type="file" name="importaccordionsfile" accept=".json,application/json,.zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed">107 </div>108 <div class="modal-footer">109 <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>110 <input type="submit" class="btn btn-success" name="importdatasubmit" id="importdatasubmit" value="Save">111 </div>112 </div>113 </div>114 ' . wp_nonce_field("oxi-accordions-ultimate-import") . '115 </form>116 </div>';117 }118 public function manual_import_json()119 {120 if (!empty($_REQUEST['_wpnonce'])) {121 $nonce = $_REQUEST['_wpnonce'];122 }123 124 if (!empty($_POST['importdatasubmit']) && sanitize_text_field($_POST['importdatasubmit']) == 'Save') {125 if (!wp_verify_nonce($nonce, 'oxi-accordions-ultimate-import')) {126 die('You do not have sufficient permissions to access this page.');127 } else {128 if (isset($_FILES['importaccordionsfile'])) :129 130 if (!current_user_can('upload_files')) :131 wp_die(esc_html('You do not have permission to upload files.'));132 endif;133 134 $allowedMimes = [135 'json' => 'text/plain'136 ];137 138 $fileInfo = wp_check_filetype(basename($_FILES['importaccordionsfile']['name']), $allowedMimes);139 if (empty($fileInfo['ext'])) {140 wp_die(esc_html('You do not have permission to upload files.'));141 }142 143 $content = json_decode(file_get_contents($_FILES['importaccordionsfile']['tmp_name']), true);144 145 if (empty($content)) {146 return new \WP_Error('file_error', 'Invalid File');147 }148 $style = $content['style'];149 150 if (!is_array($style) || $style['type'] != 'accordions-or-faqs') {151 return new \WP_Error('file_error', 'Invalid Content In File');152 }153 154 $ImportApi = new \OXI_ACCORDIONS_PLUGINS\Classes\API();155 $new_slug = $ImportApi->post_json_import($content);156 echo '<script type="text/javascript"> document.location.href = "' . $new_slug . '"; </script>';157 exit;158 endif;159 }160 }161 }162 40 163 41 public function public_render() … … 253 131 } 254 132 133 /** 134 * Plugin Name Convert to View 135 * 136 * @since 2.0.1 137 */ 138 public function name_converter($data) 139 { 140 $data = str_replace('tyle', 'tyle ', $data); 141 return ucwords($data); 142 } 143 144 public function create_new() 145 { 146 echo '<div class="oxi-addons-row"> 147 <div class="oxi-addons-col-1 oxi-import"> 148 <div class="oxi-addons-style-preview"> 149 <div class="oxilab-admin-style-preview-top"> 150 <a href="#" id="oxilab-accordions-import-json"> 151 <div class="oxilab-admin-add-new-item"> 152 <span> 153 <i class="fas fa-plus-circle oxi-icons"></i> 154 Import Accordions 155 </span> 156 </div> 157 </a> 158 </div> 159 </div> 160 </div> 161 </div>'; 162 163 echo '<div class="modal fade" id="oxi-addons-style-create-modal" > 164 <form method="post" id="oxi-addons-style-modal-form"> 165 <div class="modal-dialog modal-sm modal-dialog-centered"> 166 <div class="modal-content"> 167 <div class="modal-header"> 168 <h4 class="modal-title">Tabs Clone</h4> 169 <button type="button" class="close" data-dismiss="modal">×</button> 170 </div> 171 <div class="modal-body"> 172 <div class=" form-group row"> 173 <label for="addons-style-name" class="col-sm-6 col-form-label" oxi-addons-tooltip="Give your Shortcode Name Here">Name</label> 174 <div class="col-sm-6 addons-dtm-laptop-lock"> 175 <input class="form-control" type="text" value="" id="addons-style-name" name="addons-style-name" required> 176 </div> 177 </div> 178 </div> 179 <div class="modal-footer"> 180 181 <input type="hidden" id="oxistyleid" name="oxistyleid" value=""> 182 <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> 183 <input type="submit" class="btn btn-success" name="addonsdatasubmit" id="addonsdatasubmit" value="Save"> 184 </div> 185 </div> 186 </div> 187 </form> 188 </div> 189 '; 190 echo '<div class="modal fade" id="oxi-addons-style-import-modal" > 191 <form method="post" id="oxi-addons-import-modal-form" enctype="multipart/form-data"> 192 <div class="modal-dialog modal-sm modal-dialog-centered"> 193 <div class="modal-content"> 194 <div class="modal-header"> 195 <h4 class="modal-title">Import Form</h4> 196 <button type="button" class="close" data-dismiss="modal">×</button> 197 </div> 198 <div class="modal-body"> 199 <input class="form-control" type="file" name="importaccordionsfile" accept=".json,application/json,.zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed"> 200 </div> 201 <div class="modal-footer"> 202 <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> 203 <input type="submit" class="btn btn-success" name="importdatasubmit" id="importdatasubmit" value="Save"> 204 </div> 205 </div> 206 </div> 207 ' . wp_nonce_field("oxi-accordions-ultimate-import") . ' 208 </form> 209 </div>'; 210 } 211 public function manual_import_json() 212 { 213 if (!empty($_REQUEST['_wpnonce'])) { 214 $nonce = $_REQUEST['_wpnonce']; 215 } 216 217 if (!empty($_POST['importdatasubmit']) && sanitize_text_field($_POST['importdatasubmit']) == 'Save') { 218 if (!wp_verify_nonce($nonce, 'oxi-accordions-ultimate-import')) { 219 die('You do not have sufficient permissions to access this page.'); 220 } else { 221 if (isset($_FILES['importaccordionsfile'])) : 222 223 if (!current_user_can('upload_files')) : 224 wp_die(esc_html('You do not have permission to upload files.')); 225 endif; 226 227 $allowedMimes = [ 228 'json' => 'text/plain' 229 ]; 230 231 $fileInfo = wp_check_filetype(basename($_FILES['importaccordionsfile']['name']), $allowedMimes); 232 if (empty($fileInfo['ext'])) { 233 wp_die(esc_html('You do not have permission to upload files.')); 234 } 235 236 $content = json_decode(file_get_contents($_FILES['importaccordionsfile']['tmp_name']), true); 237 238 if (empty($content)) { 239 return new \WP_Error('file_error', 'Invalid File'); 240 } 241 $style = $content['style']; 242 243 if (!is_array($style) || $style['type'] != 'accordions-or-faqs') { 244 return new \WP_Error('file_error', 'Invalid Content In File'); 245 } 246 247 $ImportApi = new \OXI_ACCORDIONS_PLUGINS\Classes\API(); 248 $new_slug = $ImportApi->post_json_import($content); 249 echo '<script type="text/javascript"> document.location.href = "' . $new_slug . '"; </script>'; 250 exit; 251 endif; 252 } 253 } 254 } 255 255 public function database_data() 256 256 { -
accordions-or-faqs/trunk/Includes/Frontend.php
r2959347 r2998356 41 41 } 42 42 43 /** 44 * Register page through WordPress's hooks. 45 */ 46 public function add_dashboard_page() 47 { 48 add_dashboard_page('', '', 'read', 'oxi-accordions-style-view', ''); 49 } 50 51 52 53 public function template_header() 43 44 /** 45 * Outputs the simplified footer. 46 */ 47 public function template_footer() 54 48 { 55 49 ?> 56 <!DOCTYPE html> 57 <html <?php language_attributes(); ?>> 58 <meta name="viewport" content="width=device-width" /> 59 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 60 <title><?php esc_html_e('Accordions - Multiple Accordions or FAQs Builders', 'accordions-or-faqs'); ?></title> 61 <?php wp_head(); ?> 62 </head> 63 64 <body class="shortcode-addons-template-body" id="shortcode-addons-template-body"> 65 <?php 66 } 67 68 /** 69 * Outputs the simplified footer. 70 */ 71 public function template_footer() 72 { 73 ?> 74 <?php wp_footer(); ?> 50 <?php wp_footer(); ?> 75 51 </body> 76 52 77 53 </html> 78 <?php54 <?php 79 55 } 80 56 … … 214 190 } 215 191 192 /** 193 * Register page through WordPress's hooks. 194 */ 195 public function add_dashboard_page() 196 { 197 add_dashboard_page('', '', 'read', 'oxi-accordions-style-view', ''); 198 } 199 200 201 202 public function template_header() 203 { 204 ?> 205 <!DOCTYPE html> 206 <html <?php language_attributes(); ?>> 207 <meta name="viewport" content="width=device-width" /> 208 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 209 <title><?php esc_html_e('Accordions - Multiple Accordions or FAQs Builders', 'accordions-or-faqs'); ?></title> 210 <?php wp_head(); ?> 211 </head> 212 213 <body class="shortcode-addons-template-body" id="shortcode-addons-template-body"> 214 <?php 215 } 216 216 public function enqueue_scripts() 217 217 { -
accordions-or-faqs/trunk/Includes/Settings.php
r2922783 r2998356 11 11 * author @biplob018 12 12 */ 13 class Settings { 13 class Settings 14 { 14 15 15 16 use \OXI_ACCORDIONS_PLUGINS\Helper\Additional; … … 20 21 public $status; 21 22 22 public function Render() { 23 ?> 23 24 /** 25 * Admin Notice JS file loader 26 * @return void 27 */ 28 public function admin_ajax() 29 { 30 $this->admin_settings_additional(); 31 wp_enqueue_script('oxi-accordions-settings-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/settings.js', false, 'accordions-or-faqs'); 32 } 33 34 /** 35 * Constructor of Oxilab Accordions Home Page 36 * 37 * @since 2.0.0 38 */ 39 public function __construct() 40 { 41 if (!current_user_can('manage_options')) { 42 return; 43 } 44 $this->admin(); 45 $this->admin_ajax(); 46 $this->Render(); 47 } 48 49 public function admin() 50 { 51 global $wp_roles; 52 $this->roles = $wp_roles->get_names(); 53 $this->saved_role = get_option('oxi_accordions_user_permission'); 54 $this->license = get_option('accordions_or_faqs_license_key'); 55 $this->status = get_option('accordions_or_faqs_license_status'); 56 } 57 58 public function Render() 59 { 60 ?> 24 61 <div class="wrap"> 25 <?php26 echo apply_filters('oxi-accordions-plugin/admin_menu', TRUE);27 ?>62 <?php 63 echo apply_filters('oxi-accordions-plugin/admin_menu', TRUE); 64 ?> 28 65 <div class="oxi-addons-row oxi-addons-admin-settings"> 29 66 <form method="post"> … … 38 75 <fieldset> 39 76 <select name="oxi_accordions_user_permission" id="oxi_accordions_user_permission"> 40 <?php foreach ($this->roles as $key => $role) { ?>77 <?php foreach ($this->roles as $key => $role) { ?> 41 78 <option value="<?php echo esc_attr($key); ?>" <?php selected($this->saved_role, $key); ?>><?php echo esc_html($role); ?></option> 42 79 <?php } ?> … … 115 152 <input type="text" class="regular-text" id="accordions_or_faqs_license_key" name="accordions_or_faqs_license_key" value="<?php echo esc_attr($this->license); ?>"> 116 153 <span class="oxi-addons-settings-connfirmation accordions_or_faqs_license_massage"> 117 <?php118 if ($this->status == 'valid' && empty($this->license)) :119 echo _e('<span class="oxi-confirmation-success"></span>');120 elseif ($this->status == 'valid' && !empty($this->license)) :121 echo _e('<span class="oxi-confirmation-success"></span>');122 elseif (!empty($this->license)) :123 echo _e('<span class="oxi-confirmation-failed"></span>');124 else :125 echo _e('<span class="oxi-confirmation-blank"></span>');126 endif;127 ?>154 <?php 155 if ($this->status == 'valid' && empty($this->license)) : 156 echo _e('<span class="oxi-confirmation-success"></span>'); 157 elseif ($this->status == 'valid' && !empty($this->license)) : 158 echo _e('<span class="oxi-confirmation-success"></span>'); 159 elseif (!empty($this->license)) : 160 echo _e('<span class="oxi-confirmation-failed"></span>'); 161 else : 162 echo _e('<span class="oxi-confirmation-blank"></span>'); 163 endif; 164 ?> 128 165 </span> 129 166 <span class="oxi-addons-settings-connfirmation accordions_or_faqs_license_text"> 130 <?php131 if ($this->status == 'valid' && empty($this->license)) :132 echo _e('<span class="oxi-addons-settings-massage">Pre Active</span>');133 elseif ($this->status == 'valid' && !empty($this->license)) :134 echo _e('<span class="oxi-addons-settings-massage">Active</span>');135 elseif (!empty($this->license)) :136 echo _e('<span class="oxi-addons-settings-massage">' . esc_html($this->status) . '</span>');137 else :138 echo _e('<span class="oxi-addons-settings-massage"></span>');139 endif;140 ?>167 <?php 168 if ($this->status == 'valid' && empty($this->license)) : 169 echo _e('<span class="oxi-addons-settings-massage">Pre Active</span>'); 170 elseif ($this->status == 'valid' && !empty($this->license)) : 171 echo _e('<span class="oxi-addons-settings-massage">Active</span>'); 172 elseif (!empty($this->license)) : 173 echo _e('<span class="oxi-addons-settings-massage">' . esc_html($this->status) . '</span>'); 174 else : 175 echo _e('<span class="oxi-addons-settings-massage"></span>'); 176 endif; 177 ?> 141 178 </span> 142 179 <p class="description">Activate your License to get direct plugin updates and official support.</p> … … 148 185 </div> 149 186 </div> 150 <?php 151 } 152 153 /** 154 * Admin Notice JS file loader 155 * @return void 156 */ 157 public function admin_ajax() { 158 $this->admin_settings_additional(); 159 wp_enqueue_script('oxi-accordions-settings-page', OXI_ACCORDIONS_URL . '/assets/backend/custom/settings.js', false, 'accordions-or-faqs'); 160 } 161 162 /** 163 * Constructor of Oxilab Accordions Home Page 164 * 165 * @since 2.0.0 166 */ 167 public function __construct() { 168 if (!current_user_can('manage_options')) { 169 return; 170 } 171 $this->admin(); 172 $this->admin_ajax(); 173 $this->Render(); 174 } 175 176 public function admin() { 177 global $wp_roles; 178 $this->roles = $wp_roles->get_names(); 179 $this->saved_role = get_option('oxi_accordions_user_permission'); 180 $this->license = get_option('accordions_or_faqs_license_key'); 181 $this->status = get_option('accordions_or_faqs_license_status'); 187 <?php 182 188 } 183 189 } -
accordions-or-faqs/trunk/Includes/Shortcode.php
r2922783 r2998356 11 11 * author @biplob018 12 12 */ 13 class Shortcode { 13 class Shortcode 14 { 14 15 15 16 /** … … 48 49 public $import_table; 49 50 public $define_user; 51 /** 52 * Constructor 53 * 54 * @since 2.0.0 55 */ 56 public function __construct($styleid = '', $user = 'user') 57 { 58 if (!empty((int) $styleid)) : 59 $this->styleid = $styleid; 60 $this->define_user = $user; 61 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database(); 62 $this->get_data(); 63 endif; 64 } 65 /** 66 * Confirm Transient 67 * 68 * @since 2.0.1 69 */ 70 public function get_transient() 71 { 72 if ($this->define_user == 'admin') : 73 $response = get_transient('accordions-or-faqs-template-' . $this->styleid); 74 if ($response) : 75 $new = [ 76 'rawdata' => $response, 77 'stylesheet' => '', 78 'font_family' => '' 79 ]; 80 $this->style_table = array_merge($this->style_table, $new); 81 endif; 82 endif; 83 } 50 84 85 public function render_html() 86 { 87 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Layouts\Template'; 88 if (class_exists($CLASS)) : 89 new $CLASS($this->style_table, $this->child_table, $this->define_user); 90 endif; 91 } 51 92 /** 52 93 * Get Data From Database … … 54 95 * @since 2.0.1 55 96 */ 56 public function get_data() { 97 public function get_data() 98 { 57 99 //style Data 58 100 $this->style_table = $this->database->wpdb->get_row($this->database->wpdb->prepare('SELECT * FROM ' . $this->database->parent_table . ' WHERE id = %d ', $this->styleid), ARRAY_A); … … 68 110 $this->render_html(); 69 111 } 70 71 /**72 * Constructor73 *74 * @since 2.0.075 */76 public function __construct($styleid = '', $user = 'user') {77 if (!empty((int) $styleid)) :78 $this->styleid = $styleid;79 $this->define_user = $user;80 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database();81 $this->get_data();82 endif;83 }84 85 public function render_html() {86 $CLASS = '\OXI_ACCORDIONS_PLUGINS\Layouts\Template';87 if (class_exists($CLASS)) :88 new $CLASS($this->style_table, $this->child_table, $this->define_user);89 endif;90 }91 92 /**93 * Confirm Transient94 *95 * @since 2.0.196 */97 public function get_transient() {98 if ($this->define_user == 'admin') :99 $response = get_transient('accordions-or-faqs-template-' . $this->styleid);100 if ($response) :101 $new = [102 'rawdata' => $response,103 'stylesheet' => '',104 'font_family' => ''105 ];106 $this->style_table = array_merge($this->style_table, $new);107 endif;108 endif;109 }110 112 } -
accordions-or-faqs/trunk/Layouts/Admin.php
r2959347 r2998356 121 121 } 122 122 123 124 public function thumbnail_sizes() 125 { 126 $default_image_sizes = get_intermediate_image_sizes(); 127 $thumbnail_sizes = array(); 128 foreach ($default_image_sizes as $size) { 129 $image_sizes[$size] = $size . ' - ' . intval(get_option("{$size}_size_w")) . ' x ' . intval(get_option("{$size}_size_h")); 130 $thumbnail_sizes[$size] = str_replace('_', ' ', ucfirst($image_sizes[$size])); 131 } 132 return $thumbnail_sizes; 133 } 123 134 /** 124 135 * Template Information … … 195 206 'showing' => TRUE, 196 207 ]); 197 }198 199 public function thumbnail_sizes()200 {201 $default_image_sizes = get_intermediate_image_sizes();202 $thumbnail_sizes = array();203 foreach ($default_image_sizes as $size) {204 $image_sizes[$size] = $size . ' - ' . intval(get_option("{$size}_size_w")) . ' x ' . intval(get_option("{$size}_size_h"));205 $thumbnail_sizes[$size] = str_replace('_', ' ', ucfirst($image_sizes[$size]));206 }207 return $thumbnail_sizes;208 208 } 209 209 … … 299 299 } 300 300 301 302 public function register_controls() 303 { 304 $this->start_section_header( 305 'shortcode-addons-start-tabs', 306 [ 307 'options' => [ 308 'button-settings' => esc_html__('General Settings', 'accordions-or-faqs'), 309 'custom' => esc_html__('Custom CSS', 'accordions-or-faqs'), 310 ] 311 ] 312 ); 313 $this->start_section_tabs( 314 'oxi-accordions-start-tabs', 315 [ 316 'condition' => [ 317 'oxi-tabs-start-tabs' => esc_html__('button-settings', 'accordions-or-faqs'), 318 ] 319 ] 320 ); 321 $this->start_section_devider(); 322 $this->register_general(); 323 $this->end_section_devider(); 324 325 $this->start_section_devider(); 326 $this->register_heading(); 327 $this->end_section_devider(); 328 $this->end_section_tabs(); 329 330 $this->start_section_tabs( 331 'oxi-tabs-start-tabs', 332 [ 333 'condition' => [ 334 'oxi-tabs-start-tabs' => 'custom' 335 ], 336 'padding' => '10px' 337 ] 338 ); 339 340 $this->start_controls_section( 341 'oxi-tabs-start-tabs-css', 342 [ 343 'label' => esc_html__('Custom CSS', 'accordions-or-faqs'), 344 'showing' => TRUE, 345 ] 346 ); 347 $this->add_control( 348 'oxi-tabs-custom-css', 349 $this->style, 350 [ 351 'label' => esc_html__('', 'accordions-or-faqs'), 352 'type' => Controls::TEXTAREA, 353 'default' => '', 354 'description' => esc_html__('Custom CSS Section. You can add custom css into textarea.') 355 ] 356 ); 357 $this->end_controls_section(); 358 $this->end_section_tabs(); 359 } 360 361 public function __construct($type = '') 362 { 363 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database(); 364 $this->oxiid = (!empty($_GET['styleid']) ? (int) $_GET['styleid'] : ''); 365 $this->WRAPPER = '.oxi-accordions-wrapper-' . $this->oxiid; 366 $this->CSSWRAPPER = '.oxi-accordions-wrapper-' . $this->oxiid . ' > .oxi-addons-row'; 367 if ($type != 'admin') { 368 $this->hooks(); 369 $this->render(); 370 } 371 } 372 373 public function str_replace_first($from, $to, $content) 374 { 375 $from = '/' . preg_quote($from, '/') . '/'; 376 return preg_replace($from, $to, $content, 1); 377 } 301 378 /** 302 379 * Template Parent Render … … 449 526 </div>'; 450 527 } 451 public function register_controls()452 {453 $this->start_section_header(454 'shortcode-addons-start-tabs',455 [456 'options' => [457 'button-settings' => esc_html__('General Settings', 'accordions-or-faqs'),458 'custom' => esc_html__('Custom CSS', 'accordions-or-faqs'),459 ]460 ]461 );462 $this->start_section_tabs(463 'oxi-accordions-start-tabs',464 [465 'condition' => [466 'oxi-tabs-start-tabs' => esc_html__('button-settings', 'accordions-or-faqs'),467 ]468 ]469 );470 $this->start_section_devider();471 $this->register_general();472 $this->end_section_devider();473 474 $this->start_section_devider();475 $this->register_heading();476 $this->end_section_devider();477 $this->end_section_tabs();478 479 $this->start_section_tabs(480 'oxi-tabs-start-tabs',481 [482 'condition' => [483 'oxi-tabs-start-tabs' => 'custom'484 ],485 'padding' => '10px'486 ]487 );488 489 $this->start_controls_section(490 'oxi-tabs-start-tabs-css',491 [492 'label' => esc_html__('Custom CSS', 'accordions-or-faqs'),493 'showing' => TRUE,494 ]495 );496 $this->add_control(497 'oxi-tabs-custom-css',498 $this->style,499 [500 'label' => esc_html__('', 'accordions-or-faqs'),501 'type' => Controls::TEXTAREA,502 'default' => '',503 'description' => esc_html__('Custom CSS Section. You can add custom css into textarea.')504 ]505 );506 $this->end_controls_section();507 $this->end_section_tabs();508 }509 510 public function __construct($type = '')511 {512 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database();513 $this->oxiid = (!empty($_GET['styleid']) ? (int) $_GET['styleid'] : '');514 $this->WRAPPER = '.oxi-accordions-wrapper-' . $this->oxiid;515 $this->CSSWRAPPER = '.oxi-accordions-wrapper-' . $this->oxiid . ' > .oxi-addons-row';516 if ($type != 'admin') {517 $this->hooks();518 $this->render();519 }520 }521 522 public function str_replace_first($from, $to, $content)523 {524 $from = '/' . preg_quote($from, '/') . '/';525 return preg_replace($from, $to, $content, 1);526 }527 528 } -
accordions-or-faqs/trunk/Layouts/Helper.php
r2959347 r2998356 21 21 22 22 23 /* 24 * @return void 25 * Start frequently asked questions Query 26 */ 27 28 public function register_search_options() 29 { 30 $this->start_controls_section( 31 'search-options', 32 [ 33 'label' => esc_html__('Search Options', 'accordions-or-faqs'), 34 'showing' => true, 35 'condition' => [ 36 'oxi-accordions-search-option' => 'active' 37 ], 38 ] 39 ); 40 $this->add_control( 41 'oxi-accordions-search-option-text', 42 $this->style, 43 [ 44 'label' => esc_html__('Placeholder Text', 'accordions-or-faqs'), 45 'type' => Controls::TEXT, 46 'default' => 'Search your FAQ', 47 'description' => 'Customize search option text.', 48 ] 49 ); 50 $this->add_control( 51 'oxi-accordions-search-option-alignment', 52 $this->style, 53 [ 54 'label' => esc_html__('Alignment', 'accordions-or-faqs'), 55 'type' => Controls::CHOOSE, 56 'operator' => Controls::OPERATOR_ICON, 57 'default' => 'left', 58 'options' => [ 59 'left' => [ 60 'icon' => esc_html__('fas fa-align-left', 'accordions-or-faqs'), 61 ], 62 'center' => [ 63 'icon' => esc_html__('fas fa-align-center', 'accordions-or-faqs'), 64 ], 65 'right' => [ 66 'icon' => esc_html__('fas fa-align-right', 'accordions-or-faqs'), 67 ], 68 ], 69 'selector' => [ 70 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options' => 'text-align: {{VALUE}};', 71 ], 72 'description' => 'Confirm Expand or Collapse alignment as left, center or right', 73 ] 74 ); 75 $this->add_responsive_control( 76 'oxi-accordions-search-option-width', 77 $this->style, 78 [ 79 'label' => esc_html__('Width', 'accordions-or-faqs'), 80 'type' => Controls::SLIDER, 81 'default' => [ 82 'unit' => 'px', 83 'size' => '', 84 ], 85 'range' => [ 86 'px' => [ 87 'min' => 0, 88 'max' => 2000, 89 'step' => 1, 90 ], 91 '%' => [ 92 'min' => 0, 93 'max' => 100, 94 'step' => .1, 95 ], 96 'em' => [ 97 'min' => 0, 98 'max' => 200, 99 'step' => .1, 100 ], 101 'rem' => [ 102 'min' => 0, 103 'max' => 200, 104 'step' => 0.1, 105 ], 106 ], 107 'selector' => [ 108 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'width:{{SIZE}}{{UNIT}};', 109 ], 110 'description' => 'Set the Search button’s Width.', 111 ] 112 ); 113 114 $this->add_group_control( 115 'oxi-accordions-search-option-typho', 116 $this->style, 117 [ 118 'type' => Controls::TYPOGRAPHY, 119 'selector' => [ 120 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search' => '', 121 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search::-webkit-input-placeholder' => '', 122 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-icons' => '', 123 ], 124 'description' => 'Customize the typography options for the Search Text.', 125 ] 126 ); 127 $this->add_control( 128 'oxi-accordions-search-option-color', 129 $this->style, 130 [ 131 'label' => esc_html__('Color', 'accordions-or-faqs'), 132 'type' => Controls::COLOR, 133 'default' => '#ffffff', 134 'selector' => [ 135 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search' => 'color: {{VALUE}};', 136 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:focus' => 'color: {{VALUE}};', 137 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:active' => 'color: {{VALUE}};', 138 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:hover' => 'color: {{VALUE}};', 139 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search::-webkit-input-placeholder' => 'color: {{VALUE}};', 140 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-icons' => 'color: {{VALUE}};', 141 ], 142 'description' => 'Set the search button color.', 143 ] 144 ); 145 $this->add_control( 146 'oxi-accordions-search-option-background', 147 $this->style, 148 [ 149 'type' => Controls::GRADIENT, 150 'label' => esc_html__('Background', 'accordions-or-faqs'), 151 'selector' => [ 152 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'background: {{VALUE}};', 153 ], 154 'description' => 'Customize search button with color, gradient or image properties.', 155 ] 156 ); 157 158 $this->add_group_control( 159 'oxi-accordions-search-option-border', 160 $this->style, 161 [ 162 'type' => Controls::BORDER, 163 'selector' => [ 164 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => '', 165 ], 166 'description' => 'Customize border for search button.', 167 ] 168 ); 169 $this->add_responsive_control( 170 'oxi-accordions-search-option-radius', 171 $this->style, 172 [ 173 'label' => esc_html__('Border Radius', 'accordions-or-faqs'), 174 'type' => Controls::DIMENSIONS, 175 'default' => [ 176 'unit' => 'px', 177 'size' => '', 178 ], 179 'range' => [ 180 'px' => [ 181 'min' => 0, 182 'max' => 500, 183 'step' => 1, 184 ], 185 '%' => [ 186 'min' => 0, 187 'max' => 100, 188 'step' => 1, 189 ], 190 'em' => [ 191 'min' => 0, 192 'max' => 100, 193 'step' => .1, 194 ], 195 ], 196 'selector' => [ 197 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 198 ], 199 'description' => 'Add rounded corners to the search button.', 200 ] 201 ); 202 $this->add_responsive_control( 203 'oxi-accordions-search-option-padding', 204 $this->style, 205 [ 206 'label' => esc_html__('Padding', 'accordions-or-faqs'), 207 'type' => Controls::DIMENSIONS, 208 'default' => [ 209 'unit' => 'px', 210 'size' => '', 211 ], 212 'range' => [ 213 'px' => [ 214 'min' => 0, 215 'max' => 500, 216 'step' => 1, 217 ], 218 '%' => [ 219 'min' => 0, 220 'max' => 100, 221 'step' => 1, 222 ], 223 'em' => [ 224 'min' => 0, 225 'max' => 100, 226 'step' => .1, 227 ], 228 ], 229 'selector' => [ 230 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 231 ], 232 'description' => 'Adjust your padding for search button.', 233 ] 234 ); 235 $this->add_responsive_control( 236 'oxi-accordions-search-option-margin', 237 $this->style, 238 [ 239 'label' => esc_html__('Margin', 'accordions-or-faqs'), 240 'type' => Controls::DIMENSIONS, 241 'default' => [ 242 'unit' => 'px', 243 'size' => '', 244 ], 245 'range' => [ 246 'px' => [ 247 'min' => -100, 248 'max' => 500, 249 'step' => 1, 250 ], 251 '%' => [ 252 'min' => -100, 253 'max' => 100, 254 'step' => 1, 255 ], 256 'em' => [ 257 'min' => -100, 258 'max' => 100, 259 'step' => .1, 260 ], 261 ], 262 'selector' => [ 263 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 264 ], 265 'description' => 'Adjust your margin for Search button.', 266 ] 267 ); 268 $this->end_controls_section(); 269 } 23 270 24 271 25 public function register_controls() … … 2184 1938 $this->end_controls_section(); 2185 1939 } 2186 1940 /* 1941 * @return void 1942 * Start frequently asked questions Query 1943 */ 1944 1945 public function register_search_options() 1946 { 1947 $this->start_controls_section( 1948 'search-options', 1949 [ 1950 'label' => esc_html__('Search Options', 'accordions-or-faqs'), 1951 'showing' => true, 1952 'condition' => [ 1953 'oxi-accordions-search-option' => 'active' 1954 ], 1955 ] 1956 ); 1957 $this->add_control( 1958 'oxi-accordions-search-option-text', 1959 $this->style, 1960 [ 1961 'label' => esc_html__('Placeholder Text', 'accordions-or-faqs'), 1962 'type' => Controls::TEXT, 1963 'default' => 'Search your FAQ', 1964 'description' => 'Customize search option text.', 1965 ] 1966 ); 1967 $this->add_control( 1968 'oxi-accordions-search-option-alignment', 1969 $this->style, 1970 [ 1971 'label' => esc_html__('Alignment', 'accordions-or-faqs'), 1972 'type' => Controls::CHOOSE, 1973 'operator' => Controls::OPERATOR_ICON, 1974 'default' => 'left', 1975 'options' => [ 1976 'left' => [ 1977 'icon' => esc_html__('fas fa-align-left', 'accordions-or-faqs'), 1978 ], 1979 'center' => [ 1980 'icon' => esc_html__('fas fa-align-center', 'accordions-or-faqs'), 1981 ], 1982 'right' => [ 1983 'icon' => esc_html__('fas fa-align-right', 'accordions-or-faqs'), 1984 ], 1985 ], 1986 'selector' => [ 1987 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options' => 'text-align: {{VALUE}};', 1988 ], 1989 'description' => 'Confirm Expand or Collapse alignment as left, center or right', 1990 ] 1991 ); 1992 $this->add_responsive_control( 1993 'oxi-accordions-search-option-width', 1994 $this->style, 1995 [ 1996 'label' => esc_html__('Width', 'accordions-or-faqs'), 1997 'type' => Controls::SLIDER, 1998 'default' => [ 1999 'unit' => 'px', 2000 'size' => '', 2001 ], 2002 'range' => [ 2003 'px' => [ 2004 'min' => 0, 2005 'max' => 2000, 2006 'step' => 1, 2007 ], 2008 '%' => [ 2009 'min' => 0, 2010 'max' => 100, 2011 'step' => .1, 2012 ], 2013 'em' => [ 2014 'min' => 0, 2015 'max' => 200, 2016 'step' => .1, 2017 ], 2018 'rem' => [ 2019 'min' => 0, 2020 'max' => 200, 2021 'step' => 0.1, 2022 ], 2023 ], 2024 'selector' => [ 2025 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'width:{{SIZE}}{{UNIT}};', 2026 ], 2027 'description' => 'Set the Search button’s Width.', 2028 ] 2029 ); 2030 2031 $this->add_group_control( 2032 'oxi-accordions-search-option-typho', 2033 $this->style, 2034 [ 2035 'type' => Controls::TYPOGRAPHY, 2036 'selector' => [ 2037 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search' => '', 2038 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search::-webkit-input-placeholder' => '', 2039 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-icons' => '', 2040 ], 2041 'description' => 'Customize the typography options for the Search Text.', 2042 ] 2043 ); 2044 $this->add_control( 2045 'oxi-accordions-search-option-color', 2046 $this->style, 2047 [ 2048 'label' => esc_html__('Color', 'accordions-or-faqs'), 2049 'type' => Controls::COLOR, 2050 'default' => '#ffffff', 2051 'selector' => [ 2052 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search' => 'color: {{VALUE}};', 2053 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:focus' => 'color: {{VALUE}};', 2054 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:active' => 'color: {{VALUE}};', 2055 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search .oxi-accordions-ultimate-type-search:hover' => 'color: {{VALUE}};', 2056 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-accordions-ultimate-type-search::-webkit-input-placeholder' => 'color: {{VALUE}};', 2057 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search > .oxi-icons' => 'color: {{VALUE}};', 2058 ], 2059 'description' => 'Set the search button color.', 2060 ] 2061 ); 2062 $this->add_control( 2063 'oxi-accordions-search-option-background', 2064 $this->style, 2065 [ 2066 'type' => Controls::GRADIENT, 2067 'label' => esc_html__('Background', 'accordions-or-faqs'), 2068 'selector' => [ 2069 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'background: {{VALUE}};', 2070 ], 2071 'description' => 'Customize search button with color, gradient or image properties.', 2072 ] 2073 ); 2074 2075 $this->add_group_control( 2076 'oxi-accordions-search-option-border', 2077 $this->style, 2078 [ 2079 'type' => Controls::BORDER, 2080 'selector' => [ 2081 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => '', 2082 ], 2083 'description' => 'Customize border for search button.', 2084 ] 2085 ); 2086 $this->add_responsive_control( 2087 'oxi-accordions-search-option-radius', 2088 $this->style, 2089 [ 2090 'label' => esc_html__('Border Radius', 'accordions-or-faqs'), 2091 'type' => Controls::DIMENSIONS, 2092 'default' => [ 2093 'unit' => 'px', 2094 'size' => '', 2095 ], 2096 'range' => [ 2097 'px' => [ 2098 'min' => 0, 2099 'max' => 500, 2100 'step' => 1, 2101 ], 2102 '%' => [ 2103 'min' => 0, 2104 'max' => 100, 2105 'step' => 1, 2106 ], 2107 'em' => [ 2108 'min' => 0, 2109 'max' => 100, 2110 'step' => .1, 2111 ], 2112 ], 2113 'selector' => [ 2114 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2115 ], 2116 'description' => 'Add rounded corners to the search button.', 2117 ] 2118 ); 2119 $this->add_responsive_control( 2120 'oxi-accordions-search-option-padding', 2121 $this->style, 2122 [ 2123 'label' => esc_html__('Padding', 'accordions-or-faqs'), 2124 'type' => Controls::DIMENSIONS, 2125 'default' => [ 2126 'unit' => 'px', 2127 'size' => '', 2128 ], 2129 'range' => [ 2130 'px' => [ 2131 'min' => 0, 2132 'max' => 500, 2133 'step' => 1, 2134 ], 2135 '%' => [ 2136 'min' => 0, 2137 'max' => 100, 2138 'step' => 1, 2139 ], 2140 'em' => [ 2141 'min' => 0, 2142 'max' => 100, 2143 'step' => .1, 2144 ], 2145 ], 2146 'selector' => [ 2147 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2148 ], 2149 'description' => 'Adjust your padding for search button.', 2150 ] 2151 ); 2152 $this->add_responsive_control( 2153 'oxi-accordions-search-option-margin', 2154 $this->style, 2155 [ 2156 'label' => esc_html__('Margin', 'accordions-or-faqs'), 2157 'type' => Controls::DIMENSIONS, 2158 'default' => [ 2159 'unit' => 'px', 2160 'size' => '', 2161 ], 2162 'range' => [ 2163 'px' => [ 2164 'min' => -100, 2165 'max' => 500, 2166 'step' => 1, 2167 ], 2168 '%' => [ 2169 'min' => -100, 2170 'max' => 100, 2171 'step' => 1, 2172 ], 2173 'em' => [ 2174 'min' => -100, 2175 'max' => 100, 2176 'step' => .1, 2177 ], 2178 ], 2179 'selector' => [ 2180 '{{WRAPPER}} > .oxi-accordions-ultimate-style > .oxi-accordions-ultimate-search-options > .oxi-accordions-ultimate-search' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2181 ], 2182 'description' => 'Adjust your margin for Search button.', 2183 ] 2184 ); 2185 $this->end_controls_section(); 2186 } 2187 2187 public function register_content_height() 2188 2188 { -
accordions-or-faqs/trunk/Layouts/Template.php
r2959347 r2998356 178 178 endif; 179 179 } 180 180 public function title_special_charecter($array, $title, $subtitle) 181 { 182 $r = '<div class=\'oxi-accordions-header-title\'>'; 183 $t = false; 184 if (!empty($array[$title]) && $array[$title] != '') : 185 $t = true; 186 $r .= '<div class=\'oxi-accordions-main-title\'>' . $this->special_charecter($array[$title]) . '</div>'; 187 endif; 188 if (!empty($array[$subtitle]) && $array[$subtitle] != '') : 189 $t = true; 190 $r .= '<div class=\'oxi-accordions-sub-title\'>' . $this->special_charecter($array[$subtitle]) . '</div>'; 191 endif; 192 $r .= '</div>'; 193 if ($t) : 194 return $r; 195 endif; 196 } 197 198 public function number_special_charecter($data) 199 { 200 if (!empty($data) && $data != '') : 201 return '<div class="oxi-accordions-header-li-number ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '">' . $this->special_charecter($data) . '</div>'; 202 endif; 203 } 204 205 public function image_special_render($id = '', $array = []) 206 { 207 $value = $this->media_render($id, $array); 208 if (!empty($value)) : 209 return ' <img class="oxi-accordions-header-li-image ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '" ' . $value . '>'; 210 endif; 211 } 212 213 public function icon_special_rander($id = '') 214 { 215 $value = $this->font_awesome_render($id); 216 if (!empty($value)) : 217 return ' <div class="oxi-accordions-additional-icon oxi-accordions-additional-icon-' . esc_attr($this->oxiid) . ' ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '"> ' . $value . '</div>'; 218 endif; 219 } 220 public function __construct(array $dbdata = [], array $child = [], $admin = 'user', array $arg = [], array $keys = []) 221 { 222 if (count($dbdata) > 0) : 223 $this->dbdata = $dbdata; 224 $this->child = $child; 225 $this->admin = $admin; 226 $this->arg = $arg; 227 $this->keys = $keys; 228 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database(); 229 if (array_key_exists('id', $this->dbdata)) : 230 $this->oxiid = $this->dbdata['id']; 231 else : 232 $this->oxiid = rand(100000, 200000); 233 endif; 234 $this->loader(); 235 endif; 236 } 181 237 /** 182 238 * Single instance for all advanced accordion faqs … … 406 462 } 407 463 408 public static function allowed_tags() 409 { 410 return [ 411 'a' => [ 412 'href' => [], 413 'title' => [], 414 'class' => [], 415 'rel' => [], 416 'id' => [], 417 'style' => [] 418 ], 419 'q' => [ 420 'cite' => [], 421 'class' => [], 422 'id' => [], 423 ], 424 'img' => [ 425 'src' => [], 426 'alt' => [], 427 'height' => [], 428 'width' => [], 429 'class' => [], 430 'id' => [], 431 'style' => [] 432 ], 433 'span' => [ 434 'class' => [], 435 'id' => [], 436 'style' => [] 437 ], 438 'dfn' => [ 439 'class' => [], 440 'id' => [], 441 'style' => [] 442 ], 443 'time' => [ 444 'datetime' => [], 445 'class' => [], 446 'id' => [], 447 'style' => [], 448 ], 449 'cite' => [ 450 'title' => [], 451 'class' => [], 452 'id' => [], 453 'style' => [], 454 ], 455 'hr' => [ 456 'class' => [], 457 'id' => [], 458 'style' => [], 459 ], 460 'b' => [ 461 'class' => [], 462 'id' => [], 463 'style' => [], 464 ], 465 'p' => [ 466 'class' => [], 467 'id' => [], 468 'style' => [] 469 ], 470 'i' => [ 471 'class' => [], 472 'id' => [], 473 'style' => [] 474 ], 475 'u' => [ 476 'class' => [], 477 'id' => [], 478 'style' => [] 479 ], 480 's' => [ 481 'class' => [], 482 'id' => [], 483 'style' => [], 484 ], 485 'br' => [], 486 'em' => [ 487 'class' => [], 488 'id' => [], 489 'style' => [] 490 ], 491 'code' => [ 492 'class' => [], 493 'id' => [], 494 'style' => [], 495 ], 496 'mark' => [ 497 'class' => [], 498 'id' => [], 499 'style' => [], 500 ], 501 'small' => [ 502 'class' => [], 503 'id' => [], 504 'style' => [] 505 ], 506 'abbr' => [ 507 'title' => [], 508 'class' => [], 509 'id' => [], 510 'style' => [], 511 ], 512 'strong' => [ 513 'class' => [], 514 'id' => [], 515 'style' => [] 516 ], 517 'del' => [ 518 'class' => [], 519 'id' => [], 520 'style' => [] 521 ], 522 'ins' => [ 523 'class' => [], 524 'id' => [], 525 'style' => [] 526 ], 527 'sub' => [ 528 'class' => [], 529 'id' => [], 530 'style' => [], 531 ], 532 'sup' => [ 533 'class' => [], 534 'id' => [], 535 'style' => [], 536 ], 537 'div' => [ 538 'class' => [], 539 'id' => [], 540 'style' => [] 541 ], 542 'strike' => [ 543 'class' => [], 544 'id' => [], 545 'style' => [], 546 ], 547 'acronym' => [], 548 'h1' => [ 549 'class' => [], 550 'id' => [], 551 'style' => [], 552 ], 553 'h2' => [ 554 'class' => [], 555 'id' => [], 556 'style' => [], 557 ], 558 'h3' => [ 559 'class' => [], 560 'id' => [], 561 'style' => [], 562 ], 563 'h4' => [ 564 'class' => [], 565 'id' => [], 566 'style' => [], 567 ], 568 'h5' => [ 569 'class' => [], 570 'id' => [], 571 'style' => [], 572 ], 573 'h6' => [ 574 'class' => [], 575 'id' => [], 576 'style' => [], 577 ], 578 'button' => [ 579 'class' => [], 580 'id' => [], 581 'style' => [], 582 ], 583 'center' => [ 584 'class' => [], 585 'id' => [], 586 'style' => [], 587 ], 588 'ul' => [ 589 'class' => [], 590 'id' => [], 591 'style' => [], 592 ], 593 'ol' => [ 594 'class' => [], 595 'id' => [], 596 'style' => [], 597 ], 598 'li' => [ 599 'class' => [], 600 'id' => [], 601 'style' => [], 602 ], 603 ]; 604 } 464 605 465 606 466 public function admin_edit_panel($id) … … 845 705 return $data; 846 706 } 847 707 public static function allowed_tags() 708 { 709 return [ 710 'a' => [ 711 'href' => [], 712 'title' => [], 713 'class' => [], 714 'rel' => [], 715 'id' => [], 716 'style' => [] 717 ], 718 'q' => [ 719 'cite' => [], 720 'class' => [], 721 'id' => [], 722 ], 723 'img' => [ 724 'src' => [], 725 'alt' => [], 726 'height' => [], 727 'width' => [], 728 'class' => [], 729 'id' => [], 730 'style' => [] 731 ], 732 'span' => [ 733 'class' => [], 734 'id' => [], 735 'style' => [] 736 ], 737 'dfn' => [ 738 'class' => [], 739 'id' => [], 740 'style' => [] 741 ], 742 'time' => [ 743 'datetime' => [], 744 'class' => [], 745 'id' => [], 746 'style' => [], 747 ], 748 'cite' => [ 749 'title' => [], 750 'class' => [], 751 'id' => [], 752 'style' => [], 753 ], 754 'hr' => [ 755 'class' => [], 756 'id' => [], 757 'style' => [], 758 ], 759 'b' => [ 760 'class' => [], 761 'id' => [], 762 'style' => [], 763 ], 764 'p' => [ 765 'class' => [], 766 'id' => [], 767 'style' => [] 768 ], 769 'i' => [ 770 'class' => [], 771 'id' => [], 772 'style' => [] 773 ], 774 'u' => [ 775 'class' => [], 776 'id' => [], 777 'style' => [] 778 ], 779 's' => [ 780 'class' => [], 781 'id' => [], 782 'style' => [], 783 ], 784 'br' => [], 785 'em' => [ 786 'class' => [], 787 'id' => [], 788 'style' => [] 789 ], 790 'code' => [ 791 'class' => [], 792 'id' => [], 793 'style' => [], 794 ], 795 'mark' => [ 796 'class' => [], 797 'id' => [], 798 'style' => [], 799 ], 800 'small' => [ 801 'class' => [], 802 'id' => [], 803 'style' => [] 804 ], 805 'abbr' => [ 806 'title' => [], 807 'class' => [], 808 'id' => [], 809 'style' => [], 810 ], 811 'strong' => [ 812 'class' => [], 813 'id' => [], 814 'style' => [] 815 ], 816 'del' => [ 817 'class' => [], 818 'id' => [], 819 'style' => [] 820 ], 821 'ins' => [ 822 'class' => [], 823 'id' => [], 824 'style' => [] 825 ], 826 'sub' => [ 827 'class' => [], 828 'id' => [], 829 'style' => [], 830 ], 831 'sup' => [ 832 'class' => [], 833 'id' => [], 834 'style' => [], 835 ], 836 'div' => [ 837 'class' => [], 838 'id' => [], 839 'style' => [] 840 ], 841 'strike' => [ 842 'class' => [], 843 'id' => [], 844 'style' => [], 845 ], 846 'acronym' => [], 847 'h1' => [ 848 'class' => [], 849 'id' => [], 850 'style' => [], 851 ], 852 'h2' => [ 853 'class' => [], 854 'id' => [], 855 'style' => [], 856 ], 857 'h3' => [ 858 'class' => [], 859 'id' => [], 860 'style' => [], 861 ], 862 'h4' => [ 863 'class' => [], 864 'id' => [], 865 'style' => [], 866 ], 867 'h5' => [ 868 'class' => [], 869 'id' => [], 870 'style' => [], 871 ], 872 'h6' => [ 873 'class' => [], 874 'id' => [], 875 'style' => [], 876 ], 877 'button' => [ 878 'class' => [], 879 'id' => [], 880 'style' => [], 881 ], 882 'center' => [ 883 'class' => [], 884 'id' => [], 885 'style' => [], 886 ], 887 'ul' => [ 888 'class' => [], 889 'id' => [], 890 'style' => [], 891 ], 892 'ol' => [ 893 'class' => [], 894 'id' => [], 895 'style' => [], 896 ], 897 'li' => [ 898 'class' => [], 899 'id' => [], 900 'style' => [], 901 ], 902 ]; 903 } 848 904 public function special_charecter($data) 849 905 { … … 855 911 } 856 912 857 public function title_special_charecter($array, $title, $subtitle) 858 { 859 $r = '<div class=\'oxi-accordions-header-title\'>'; 860 $t = false; 861 if (!empty($array[$title]) && $array[$title] != '') : 862 $t = true; 863 $r .= '<div class=\'oxi-accordions-main-title\'>' . $this->special_charecter($array[$title]) . '</div>'; 864 endif; 865 if (!empty($array[$subtitle]) && $array[$subtitle] != '') : 866 $t = true; 867 $r .= '<div class=\'oxi-accordions-sub-title\'>' . $this->special_charecter($array[$subtitle]) . '</div>'; 868 endif; 869 $r .= '</div>'; 870 if ($t) : 871 return $r; 872 endif; 873 } 874 875 public function number_special_charecter($data) 876 { 877 if (!empty($data) && $data != '') : 878 return '<div class="oxi-accordions-header-li-number ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '">' . $this->special_charecter($data) . '</div>'; 879 endif; 880 } 881 882 public function image_special_render($id = '', $array = []) 883 { 884 $value = $this->media_render($id, $array); 885 if (!empty($value)) : 886 return ' <img class="oxi-accordions-header-li-image ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '" ' . $value . '>'; 887 endif; 888 } 889 890 public function icon_special_rander($id = '') 891 { 892 $value = $this->font_awesome_render($id); 893 if (!empty($value)) : 894 return ' <div class="oxi-accordions-additional-icon oxi-accordions-additional-icon-' . esc_attr($this->oxiid) . ' ' . (isset($this->style['oxi-accordions-head-additional-interface']) ? $this->style['oxi-accordions-head-additional-interface'] : '') . '"> ' . $value . '</div>'; 895 endif; 896 } 897 public function __construct(array $dbdata = [], array $child = [], $admin = 'user', array $arg = [], array $keys = []) 898 { 899 if (count($dbdata) > 0) : 900 $this->dbdata = $dbdata; 901 $this->child = $child; 902 $this->admin = $admin; 903 $this->arg = $arg; 904 $this->keys = $keys; 905 $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database(); 906 if (array_key_exists('id', $this->dbdata)) : 907 $this->oxiid = $this->dbdata['id']; 908 else : 909 $this->oxiid = rand(100000, 200000); 910 endif; 911 $this->loader(); 912 endif; 913 } 913 914 914 915 915 /** -
accordions-or-faqs/trunk/Oxilab/Plugins.php
r2959347 r2998356 32 32 return self::$instance; 33 33 } 34 35 /**36 * Constructor of Oxilab Plugins Page37 *38 * @since 1.0.039 */40 public function __construct()41 {42 $this->CSSJS_load();43 $this->Header();44 $this->Render();45 }46 47 48 public function CSSJS_load()49 {50 $this->admin_settings_additional();51 $this->extension();52 if (!current_user_can('activate_plugins')) :53 die();54 endif;55 }56 57 public function Header()58 {59 apply_filters('oxi-accordions-plugin/admin_menu', TRUE);60 $this->Admin_header();61 }62 63 34 public function Render() 64 35 { … … 156 127 <?php 157 128 } 129 /** 130 * Constructor of Oxilab Plugins Page 131 * 132 * @since 1.0.0 133 */ 134 public function __construct() 135 { 136 $this->CSSJS_load(); 137 $this->Header(); 138 $this->Render(); 139 } 140 141 142 public function CSSJS_load() 143 { 144 $this->admin_settings_additional(); 145 $this->extension(); 146 if (!current_user_can('activate_plugins')) : 147 die(); 148 endif; 149 } 150 151 public function Header() 152 { 153 apply_filters('oxi-accordions-plugin/admin_menu', TRUE); 154 $this->Admin_header(); 155 } 158 156 } -
accordions-or-faqs/trunk/Oxilab/Recommend.php
r2959347 r2998356 21 21 22 22 23 24 25 /** 26 * Admin Notice CSS file loader 27 * @return void 28 */ 29 public function admin_enqueue_scripts() 30 { 31 wp_enqueue_script("jquery"); 32 wp_enqueue_style('oxilab_accorions-admin-notice-css', OXI_ACCORDIONS_URL . '/Oxilab/css/notice.css', false, 'accordions-or-faqs'); 33 $this->dismiss_button_scripts(); 34 } 35 36 /** 37 * Admin Notice JS file loader 38 * @return void 39 */ 40 public function dismiss_button_scripts() 41 { 42 wp_enqueue_script('oxi-accordions-admin-recommend', OXI_ACCORDIONS_URL . '/Oxilab/js/recommend.js', false, 'accordions-or-faqs'); 43 wp_localize_script('oxi-accordions-admin-recommend', 'oxi_accordions_admin_recommended', ['ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('oxi_accordions_admin_recommended')]); 44 } 45 public function extension() 46 { 47 $response = get_transient(self::GET_LOCAL_PLUGINS); 48 if (!$response || !is_array($response)) { 49 $URL = self::PLUGINS; 50 $request = wp_remote_request($URL); 51 if (!is_wp_error($request)) { 52 $response = json_decode(wp_remote_retrieve_body($request), true); 53 set_transient(self::GET_LOCAL_PLUGINS, $response, 10 * DAY_IN_SECONDS); 54 } else { 55 $response = []; 56 } 57 } 58 $this->get_plugins = $response; 59 } 23 60 /** 24 61 * First Installation Track … … 79 116 endif; 80 117 } 81 82 /**83 * Admin Notice CSS file loader84 * @return void85 */86 public function admin_enqueue_scripts()87 {88 wp_enqueue_script("jquery");89 wp_enqueue_style('oxilab_accorions-admin-notice-css', OXI_ACCORDIONS_URL . '/Oxilab/css/notice.css', false, 'accordions-or-faqs');90 $this->dismiss_button_scripts();91 }92 93 /**94 * Admin Notice JS file loader95 * @return void96 */97 public function dismiss_button_scripts()98 {99 wp_enqueue_script('oxi-accordions-admin-recommend', OXI_ACCORDIONS_URL . '/Oxilab/js/recommend.js', false, 'accordions-or-faqs');100 wp_localize_script('oxi-accordions-admin-recommend', 'oxi_accordions_admin_recommended', ['ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('oxi_accordions_admin_recommended')]);101 }102 public function extension()103 {104 $response = get_transient(self::GET_LOCAL_PLUGINS);105 if (!$response || !is_array($response)) {106 $URL = self::PLUGINS;107 $request = wp_remote_request($URL);108 if (!is_wp_error($request)) {109 $response = json_decode(wp_remote_retrieve_body($request), true);110 set_transient(self::GET_LOCAL_PLUGINS, $response, 10 * DAY_IN_SECONDS);111 } else {112 $response = [];113 }114 }115 $this->get_plugins = $response;116 }117 118 118 /** 119 119 * Admin Notice Ajax loader -
accordions-or-faqs/trunk/Oxilab/Reviews.php
r2959347 r2998356 16 16 17 17 18 19 20 /** 21 * Admin Notice CSS file loader 22 * @return void 23 */ 24 public function admin_enqueue_scripts() 25 { 26 wp_enqueue_script("jquery"); 27 wp_enqueue_style('oxi-accordions-admin-notice', OXI_ACCORDIONS_URL . '/Oxilab/css/notice.css', false, 'accordions-or-faqs'); 28 $this->dismiss_button_scripts(); 29 } 30 31 /** 32 * Admin Notice JS file loader 33 * @return void 34 */ 35 public function dismiss_button_scripts() 36 { 37 wp_enqueue_script('oxi-accordions-admin-notice', OXI_ACCORDIONS_URL . '/Oxilab/js/notice.js', false, 'accordions-or-faqs'); 38 wp_localize_script('oxi-accordions-admin-notice', 'oxi_accordions_reviews_notice', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('oxi_accordions_reviews_notice'))); 39 } 40 /** 41 * Admin Notice Ajax loader 42 * @return void 43 */ 44 public function notice_dissmiss() 45 { 46 if (isset($_POST['_wpnonce']) || wp_verify_nonce(sanitize_key(wp_unslash($_POST['_wpnonce'])), 'oxi_accordions_reviews_notice')) : 47 $notice = isset($_POST['notice']) ? sanitize_text_field($_POST['notice']) : ''; 48 if ($notice == 'maybe') : 49 $data = strtotime("now"); 50 update_option('accordions_or_faqs_activation_date', $data); 51 else : 52 update_option('accordions_or_faqs_no_bug', $notice); 53 endif; 54 echo esc_html($notice); 55 else : 56 return; 57 endif; 58 59 die(); 60 } 18 61 /** 19 62 * First Installation Track … … 61 104 </div>'; 62 105 } 63 64 /**65 * Admin Notice CSS file loader66 * @return void67 */68 public function admin_enqueue_scripts()69 {70 wp_enqueue_script("jquery");71 wp_enqueue_style('oxi-accordions-admin-notice', OXI_ACCORDIONS_URL . '/Oxilab/css/notice.css', false, 'accordions-or-faqs');72 $this->dismiss_button_scripts();73 }74 75 /**76 * Admin Notice JS file loader77 * @return void78 */79 public function dismiss_button_scripts()80 {81 wp_enqueue_script('oxi-accordions-admin-notice', OXI_ACCORDIONS_URL . '/Oxilab/js/notice.js', false, 'accordions-or-faqs');82 wp_localize_script('oxi-accordions-admin-notice', 'oxi_accordions_reviews_notice', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('oxi_accordions_reviews_notice')));83 }84 /**85 * Admin Notice Ajax loader86 * @return void87 */88 public function notice_dissmiss()89 {90 if (isset($_POST['_wpnonce']) || wp_verify_nonce(sanitize_key(wp_unslash($_POST['_wpnonce'])), 'oxi_accordions_reviews_notice')) :91 $notice = isset($_POST['notice']) ? sanitize_text_field($_POST['notice']) : '';92 if ($notice == 'maybe') :93 $data = strtotime("now");94 update_option('accordions_or_faqs_activation_date', $data);95 else :96 update_option('accordions_or_faqs_no_bug', $notice);97 endif;98 echo esc_html($notice);99 else :100 return;101 endif;102 103 die();104 }105 106 106 /** 107 107 * Revoke this function when the object is created. -
accordions-or-faqs/trunk/Oxilab/Welcome.php
r2959347 r2998356 16 16 use \OXI_ACCORDIONS_PLUGINS\Helper\Additional; 17 17 18 public function header() 18 19 public function __construct() 19 20 { 20 $this-> admin_css();21 apply_filters('oxi-accordions-plugin/admin_menu', TRUE);21 $this->header(); 22 $this->Public_Render(); 22 23 } 23 24 24 public function Public_Render() 25 25 { … … 98 98 } 99 99 100 101 102 public function __construct() 100 public function header() 103 101 { 104 $this-> header();105 $this->Public_Render();102 $this->admin_css(); 103 apply_filters('oxi-accordions-plugin/admin_menu', TRUE); 106 104 } 107 105 } -
accordions-or-faqs/trunk/index.php
r2959347 r2998356 7 7 Author: Biplob Adhikari 8 8 Author URI: http://www.oxilab.org/ 9 Version: 2.3. 39 Version: 2.3.5 10 10 */ 11 11 if (!defined('ABSPATH')) … … 16 16 define('OXI_ACCORDIONS_PATH', plugin_dir_path(__FILE__)); 17 17 define('OXI_ACCORDIONS_URL', plugins_url('/', __FILE__)); 18 define('OXI_ACCORDIONS_PLUGIN_VERSION', '2.3. 3');18 define('OXI_ACCORDIONS_PLUGIN_VERSION', '2.3.5'); 19 19 define('OXI_ACCORDIONS_TEXTDOMAIN', 'accordions-or-faqs'); 20 20 define('OXI_ACCORDIONS_PREMIUM', 'oxi-accordions-plugin/pro_version'); -
accordions-or-faqs/trunk/readme.txt
r2959347 r2998356 4 4 Tags: accordion, accordion plugin, FAQ, collapse, accordion plugin jquery, accordion plugin wordpress, accordion shortcode 5 5 Requires at least: 3.8 6 Stable tag: 2.3. 47 Tested up to: 6. 3.06 Stable tag: 2.3.5 7 Tested up to: 6.4.1 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.