¨ rõõU˙˙˙˙Pm?˙rõõUĀn=ÄæqõõUPPnuØ rõõU€n<ĘĶqõõU`€n&€ÁqõõUp`o&˙rõõU`q=ÄæqõõUpPqurõõU°qbÄqõõU°Āq ÜŊqõõUĀ q+˙rõõUĐ r=ÄæqõõUPPruØ rõõUĐr<ĘĶqõõUpĐr&ėqõõUp€u+˙rõõU€0v=˙rõõU€@v=ÄæqõõU`PvuØ rõõUđv<ũqõõUđPvu˙rõõU€Pv=ÄæqõõU`PvuØ rõõUv<rõõU`v5ŊqõõU`vAÄæqõõU`pvurõõU vĘĶqõõU`  v&˙rõõU`pw=ÄæqõõU`PwurõõU@wÎĖqõõU@€Pw˙rõõU0w=˙rõõU` w=ÄæqõõU`PwurõõU`wũqõõU`Pwu˙rõõU€°w=ÄæqõõU`PwuØ rõõUpw<ũqõõUp`wuØ rõõU€w<JĮqõõUP€wNÔqõõU`w&˙rõõUĀ}=˙rõõU`Đ}=ÄæqõõU`P}urõõU°}ũqõõU°P}u×rõõU}<˙rõõUpā=ÄæqõõUpPuÄæqõõU``urõõUЁbÄqõõUĐā ÜŊqõõUā@+šÖqõõU`đ€&ZĩqõõU@€*šÖqõõU`ƒ&íqõõU`†>^rõõU˙˙˙˙‡>¨ rõõU˙˙˙˙P…?¨ rõõU˙˙˙˙`…?¨ rõõU˙˙˙˙p…?¨ rõõU˙˙˙˙€…?ŸrõõU…@ŸrõõU …@ŸrõõU °…@ŸrõõU0Ā…@˙rõõU@@‡=ÄæqõõUPP‡uÄæqõõUĀ`‡uy rõõUPp‡AÄæqõõU€€‡uÄæqõõU°‡uØ rõõUā‡<ĘĶqõõUĐā‡&ėqõõU ā‰+*įqõõU Š{ÜŊqõõUŠ+˙rõõU€`‹=ÄæqõõU P‹uØ rõõU‹<rõõUp ‹ÎĖqõõU €0‹NÔqõõU 0‹&ZĩqõõU ‹*āįqõõUPPrõõUP`ÎĖqõõU` pNÔqõõU p &ZĩqõõU@*šÖqõõU ° &ėqõõU`“+˙rõõUĀ”=ÄæqõõUP”uØ rõõU ”<rõõUĐ °”ÎĖqõõU°āĀ”ZÆqõõUĀ Đ”ÎĖqõõUĐđā”ZÆqõõUāĐđ”ÎĖqõõUđ”NÔqõõUĐ”&˙rõõU` ¨=y rõõU P¨AÄæqõõUĐ`¨uÄæqõõUPp¨uÄæqõõU`€¨uÄæqõõUp¨uÄæqõõU€ ¨uÄæqõõU°¨uÄæqõõU°Ā¨uÄæqõõUĀ ШuÄæqõõU  ā¨uØ rõõU ¨<ĘĶqõõUĐ ¨&íqõõUĐĒ>^rõõU0˙˙˙˙Ģ>mm6°m7m7m7m8 'sanitize_type' => array(array($this->wph->functions, 'sanitize_file_path_name')), 'processing_order' => 16 ); } return $this->module_settings; } function set_module_components_description( $component_settings ) { $all_plugins = $this->wph->functions->get_plugins(); foreach ( $component_settings as $component_key => $component_setting ) { if ( ! isset ( $component_setting['id'] ) ) continue; switch ( $component_setting['id'] ) { case 'new_plugin_path' : $component_setting = array_merge ( $component_setting , array( 'label' => __('New Plugins Path', 'wp-hide-security-enhancer'), 'description' => __('The default plugins path is set to', 'wp-hide-security-enhancer') . ' '. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['plugins_url']) .'', 'help' => array( 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('New Plugins Path', 'wp-hide-security-enhancer'), 'description' => __("Use any alphanumeric symbols for this field which will be used as the new slug for the plugins folder. Presuming the `apps` slug is being used, all plugins urls become to something like this:", 'wp-hide-security-enhancer') . "

http://-domain-name-/apps/jetpack/", 'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-plugins/' ), 'value_description' => 'e.g. apps', ) ); break; case 'block_plugins_url' : $component_setting = array_merge ( $component_setting , array( 'label' => __('Block plugins URL', 'wp-hide-security-enhancer'), 'description' => __('Block default /wp-content/plugins/ files from being accesible through default urls.', 'wp-hide-security-enhancer'), 'help' => array( 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Block plugins URL', 'wp-hide-security-enhancer'), 'description' => __("This blocks the default wp-content/plugins/ url.
The functionality apply only if New Plugins Path option is filled in.", 'wp-hide-security-enhancer'), 'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-plugins/' ), 'advanced_option' => array( 'description' => '' . __('This is an advanced option !', 'wp-hide-security-enhancer') . '
' . __('This can break the layout if server not supporting the feature. Ensure `New Plugins Path` option works fine before activate this. Once active test it thoroughly.
If not working, set to No to revert.', 'wp-hide-security-enhancer') ), 'options' => array( 'no' => __('No', 'wp-hide-security-enhancer'), 'yes' => __('Yes', 'wp-hide-security-enhancer'), ), ) ); break; case preg_match('/^new_plugin_path_[\w-]+$/', $component_setting['id'] ) === 1 : //get active plugins $active_plugins = (array) get_option( 'active_plugins', array() ); foreach( $active_plugins as $active_plugin ) { //exclude this plugins if( in_array($active_plugin, array('wp-hide-security-enhancer/wp-hide.php', 'wp-hide-security-enhancer-pro/wp-hide.php')) ) continue; $plugin_slug = sanitize_title($active_plugin); if(!isset($all_plugins[$active_plugin])) continue; if ( 'new_plugin_path_' . $plugin_slug !== $component_setting['id'] ) continue; $pluding_data = $all_plugins[$active_plugin]; $component_setting = array_merge ( $component_setting , array( 'label' => __('New Path for', 'wp-hide-security-enhancer') . " " . $pluding_data['Name'] ." ". __('plugin', 'wp-hide-security-enhancer'), 'description' => __('This setting if set, overwrites the', 'wp-hide-security-enhancer') . ' ' . __('New Plugin Path', 'wp-hide-security-enhancer') . ' ' . __('value for this plugin.', 'wp-hide-security-enhancer'), 'help' => array( 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('New Path for', 'wp-hide-security-enhancer') . " " . $pluding_data['Name'] ." ", 'description' => "Use any alphanumeric symbols for this field which will be used as the new slug for the plugin folder. Presuming the `module_name` slug is being used, this particular plugin urls become to:

http://-domain-name-/module_name/", 'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-plugins/' ), 'value_description' => 'e.g. modules/module' . rand( 100,999 ), )); } break; } $component_settings[ $component_key ] = $component_setting; } return $component_settings; } function _init_new_plugin_path($saved_field_data) { //add custom plugins path replacements //get active plugins $active_plugins = (array) get_option( 'active_plugins', array() ); foreach($active_plugins as $active_plugin) { $active_plugin_split = explode('/', $active_plugin); $active_plugin_directory = $active_plugin_split[0]; $plugin_slug = sanitize_title($active_plugin); $option_namespace = 'new_plugin_path_' . $plugin_slug; //check if plugin have custom url $plugin_custom_path = $this->wph->functions->get_module_item_setting($option_namespace); if(empty($plugin_custom_path)) continue; //add custom path $new_url = trailingslashit( site_url() ) . $plugin_custom_path; if(!empty($path)) $new_url = trailingslashit( $new_url ) . $path; //add replacement $new_plugin_path = $this->wph->functions->untrailingslashit_all( $this->wph->functions->get_module_item_setting('new_plugin_path') ); $replace_url = trailingslashit( trailingslashit( WP_PLUGIN_URL ) . $active_plugin_directory ); $replacement_url = trailingslashit( trailingslashit( home_url() ) . $plugin_custom_path ); //replace any spaces $replace_url = str_replace (" ", "%20", $replace_url ); $this->wph->functions->add_replacement( $replace_url, $replacement_url); } if(empty($saved_field_data)) return FALSE; //add default plugin path replacement $new_plugin_path = $this->wph->functions->untrailingslashit_all( $this->wph->functions->get_module_item_setting('new_plugin_path') ); $new_plugin_path = trailingslashit( home_url() ) . untrailingslashit( $new_plugin_path ); $this->wph->functions->add_replacement( WP_PLUGIN_URL, $new_plugin_path ); return TRUE; } function _callback_saved_new_plugin_path($saved_field_data) { $processing_response = array(); $rewrite = ''; $plugin_path = $this->wph->functions->get_url_path( WP_PLUGIN_URL ); $path = ''; if(!empty($saved_field_data)) $path .= trailingslashit( $saved_field_data ); $rewrite_to = $this->wph->functions->get_rewrite_to_base( $plugin_path ); //add custom rewrite for plugins //get active plugins $active_plugins = (array) get_option( 'active_plugins', array() ); foreach($active_plugins as $active_plugin) { $active_plugin_split = explode('/', $active_plugin); $active_plugin_directory = $active_plugin_split[0]; $plugin_slug = sanitize_title($active_plugin); $option_namespace = 'new_plugin_path_' . $plugin_slug; //check if plugin have custom url $plugin_custom_path = $this->wph->functions->get_module_item_setting($option_namespace); if(empty($plugin_custom_path)) continue; //add custom path $new_url = trailingslashit( site_url() ) . $plugin_custom_path; if($path != '/') $new_url = trailingslashit( $new_url ) . $path; $plugin_rewrite_to = $this->wph->functions->get_rewrite_to_base( trailingslashit($plugin_path) . $active_plugin_directory ); if($this->wph->server_htaccess_config === TRUE) $rewrite .= "\nRewriteRule ^" . trailingslashit( $plugin_custom_path ) . '(.+) "'. $plugin_rewrite_to .'$1" [L,QSA]'; if($this->wph->server_web_config === TRUE) $rewrite .= ' '; } if( !empty($path) && !empty($saved_field_data)) { if($this->wph->server_htaccess_config === TRUE) $rewrite .= "\nRewriteRule ^" . trailingslashit( $path ) . '(.+) '. $rewrite_to .'$1 [L,QSA]'; if($this->wph->server_web_config === TRUE) $rewrite .= ' '; } $processing_response['rewrite'] = $rewrite; return $processing_response; } function _callback_saved_block_plugins_url($saved_field_data) { $processing_response = array(); if(empty($saved_field_data) || $saved_field_data == 'no') return FALSE; //prevent from blocking if the wp-include is not modified $new_theme_path = ltrim(rtrim($this->wph->functions->get_module_item_setting('new_plugin_path'), "/"), "/"); if (empty( $new_theme_path )) return FALSE; $home_url = defined('WP_HOME') ? WP_HOME : get_option('home'); $home_url = untrailingslashit($home_url); $default_plugin_url = untrailingslashit ( WP_PLUGIN_URL ); $default_plugin_url = str_replace( $home_url, "", $default_plugin_url); $default_plugin_url = ltrim(rtrim($default_plugin_url, "/"), "/"); $rewrite_to = $this->wph->functions->get_rewrite_to_base( 'index.php', TRUE, FALSE, 'site_path' ); $text = ''; if($this->wph->server_htaccess_config === TRUE) { $text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n"; $text .= "RewriteRule ^". $default_plugin_url ."(.+) ". $rewrite_to ."?wph-throw-404 [L]"; } if($this->wph->server_web_config === TRUE) $text = ' '; $processing_response['rewrite'] = $text; return $processing_response; } } ?>