Changeset 2811405
- Timestamp:
- 11/03/2022 07:28:21 PM (3 years ago)
- Location:
- ibehroozir
- Files:
-
- 29 added
- 3 edited
-
assets/ezgif.com-gif-maker (1).jpg (added)
-
tags/0.0.5 (added)
-
tags/0.0.5/assets (added)
-
tags/0.0.5/assets/img (added)
-
tags/0.0.5/assets/img/copyright.png (added)
-
tags/0.0.5/assets/img/icon.png (added)
-
tags/0.0.5/assets/lib (added)
-
tags/0.0.5/assets/lib/bootstrap-icons.css (added)
-
tags/0.0.5/assets/lib/bootstrap.bundle.min.js (added)
-
tags/0.0.5/assets/lib/bootstrap.min.css (added)
-
tags/0.0.5/assets/lib/breakpoints.css (added)
-
tags/0.0.5/assets/lib/font.css (added)
-
tags/0.0.5/assets/lib/fonts (added)
-
tags/0.0.5/assets/lib/fonts/Vazirmatn[wght].woff2 (added)
-
tags/0.0.5/assets/lib/fonts/admin.css (added)
-
tags/0.0.5/assets/lib/fonts/bootstrap-icons.woff (added)
-
tags/0.0.5/assets/lib/fonts/bootstrap-icons.woff2 (added)
-
tags/0.0.5/assets/lib/iziToast.min.css (added)
-
tags/0.0.5/assets/lib/iziToast.min.js (added)
-
tags/0.0.5/assets/lib/jquery.lazyimg.min.js (added)
-
tags/0.0.5/assets/lib/js.cookie.min.js (added)
-
tags/0.0.5/assets/lib/popper.min.js (added)
-
tags/0.0.5/assets/lib/script.js (added)
-
tags/0.0.5/assets/lib/style.css (added)
-
tags/0.0.5/iBehroozir.php (added)
-
tags/0.0.5/include (added)
-
tags/0.0.5/include/ib.php (added)
-
tags/0.0.5/readme.txt (added)
-
tags/0.0.5/uninstall.php (added)
-
trunk/iBehroozir.php (modified) (2 diffs)
-
trunk/include/ib.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ibehroozir/trunk/iBehroozir.php
r2810509 r2811405 7 7 * Plugin URI: 8 8 * Description: iBehrooz.ir Plugin Base Panel. 9 * Version: 0.0. 49 * Version: 0.0.5 10 10 * Author: iBehrooz 11 11 * Author URI: http://iBehrooz.ir … … 14 14 15 15 defined( 'ABSPATH' ) or die( 'Not Authorized!' ); 16 16 17 define( "IBiBehroozirVersion", get_file_data(__FILE__, array('Version' => 'Version'), false)['Version'] ); 18 17 19 require_once( plugin_dir_path( __FILE__ ) . '/include/ib.php' ); 18 -
ibehroozir/trunk/include/ib.php
r2810509 r2811405 12 12 add_action('admin_enqueue_scripts', array($this,'admin_enqueue_scripts')); 13 13 add_action('wp_enqueue_scripts', array($this,'wp_enqueue_scripts')); 14 add_action('admin_menu', array($this,'plugin_admin_menu_function')); 14 add_action('admin_menu', array($this,'admin_menu')); 15 add_filter( 'auto_update_plugin', array($this,'auto_update_plugin'), 10, 2 ); 15 16 } 16 function plugin_admin_menu_function()17 function admin_menu() 17 18 { 18 19 $page_title = 'iBehrooz.ir'; … … 24 25 $position = 100; 25 26 add_menu_page($page_title, $menu_title, $capability, $slug, $callback, $icon, $position); 26 27 27 28 if ( is_plugin_active( 'digikalascraper/digikalaScraper.php' ) ) { 28 29 add_submenu_page($slug, 'digikalaScraper' , 'digikalaScraper', 'manage_options', 'digikalaScraper', null); 29 30 } 31 32 if ( is_plugin_active( 'ibtoolbox/ibToolBox.php' ) ) { 33 add_submenu_page($slug, 'ibToolBox' , 'ibToolBox', 'manage_options', 'ibToolBox', null); 34 } 30 35 31 36 } 37 38 function auto_update_plugin( $update, $item ) { 39 $pluginLists = array_map('strtolower', ['iBehroozir', 'digikalaScraper', 'ibToolBox']); 40 $slug = strtolower(basename($item->id)); 41 if ( in_array($slug, $pluginLists) ) { 42 return true; 43 } 44 return $update; 45 } 32 46 function wp_remote_get($url){ 47 ini_set('display_errors', "Off"); 33 48 $response = wp_remote_get( $url , array('headers' => array('Accept' => 'application/json'))); 34 if ( ( !is_wp_error($response)) && (200 === wp_remote_retrieve_response_code( $response ) )){35 if ( trim($response['body'])!==""){49 if (!is_wp_error($response) && wp_remote_retrieve_response_code( $response ) === 200){ 50 if (!is_wp_error($response['body']) && trim($response['body'])!==""){ 36 51 return $response['body']; 37 52 } … … 41 56 function is_ib_url() 42 57 { 43 return strpos($_SERVER['REQUEST_URI'], self::pluginBaseCleanURL) !== false 44 || 45 strpos($_SERVER['REQUEST_URI'], 'digikalaScraper') !== false; 58 if (strpos($_SERVER['REQUEST_URI'], "admin.php?page=") !== false){ 59 $ok = array(); 60 $pluginLists = array_map('strtolower', ['iBehrooz.ir', 'digikalaScraper', 'ibToolBox']); 61 $slug = strtolower(explode('=', trim($_SERVER['REQUEST_URI']))[1]); 62 foreach ($pluginLists as $v){ 63 $vslug = strtolower(explode('=', trim($_SERVER['REQUEST_URI']))[1]); 64 $ok[] = strpos($vslug, $v) !== false; 65 } 66 } 67 return isset($ok) ? in_array($slug, $ok) : false; 46 68 } 47 69 function admin_enqueue_scripts() … … 80 102 81 103 $is_plugin_active_ib_class = is_plugin_active( "ibehroozir/iBehroozir.php" ) ? "disabled" : null; 82 $is_plugin_active_ib_text = $is_plugin_active_ib_class === null ? "install addon from WordPress" : "addoninstalled";104 $is_plugin_active_ib_text = $is_plugin_active_ib_class === null ? "install from WordPress" : "base panel installed"; 83 105 84 106 $is_plugin_active_digikalascraper_class = is_plugin_active( 'digikalascraper/digikalaScraper.php' ) ? "disabled" : null; 85 107 $is_plugin_active_digikalascraper_text = $is_plugin_active_digikalascraper_class === null ? "install addon from WordPress" : "addon installed"; 86 108 87 $is_plugin_active_ibtoolbox_class = is_plugin_active( 'ibtoolbox/i BToolBox.php' ) ? "disabled" : null;109 $is_plugin_active_ibtoolbox_class = is_plugin_active( 'ibtoolbox/ibToolBox.php' ) ? "disabled" : null; 88 110 $is_plugin_active_ibtoolbox_text = $is_plugin_active_ibtoolbox_class === null ? "install addon from WordPress" : "addon installed"; 89 111 90 112 esc_html_e(_e(' 91 113 <div class="container-fluid ibehroozir"> -
ibehroozir/trunk/readme.txt
r2810511 r2811405 6 6 Tested up to: 6.0.3 7 7 Requires PHP: 8.0 8 Stable tag: 0.0. 48 Stable tag: 0.0.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 12 == Description == 13 iBehrooz.ir Plugin Base Panel. 13 iBehrooz.ir Plugin Base Panel. 14 14 15 15 == credits ==
Note: See TracChangeset
for help on using the changeset viewer.