當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ITSEC_Lib::safe_jquery_version方法代碼示例

本文整理匯總了PHP中ITSEC_Lib::safe_jquery_version方法的典型用法代碼示例。如果您正苦於以下問題:PHP ITSEC_Lib::safe_jquery_version方法的具體用法?PHP ITSEC_Lib::safe_jquery_version怎麽用?PHP ITSEC_Lib::safe_jquery_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ITSEC_Lib的用法示例。


在下文中一共展示了ITSEC_Lib::safe_jquery_version方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save_settings


//.........這裏部分代碼省略.........
         if (update_site_option('itsec_ban_users', $settings['itsec_ban_users'])) {
             $input = $settings['itsec_ban_users'];
             if ($input['host_list'] !== $old_settings['host_list'] || $input['enabled'] !== $old_settings['enabled'] || $input['default'] !== $old_settings['default'] || $input['agent_list'] !== $old_settings['agent_list']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             $updated = true;
         }
     }
     if (isset($settings['itsec_brute_force'])) {
         if (update_site_option('itsec_brute_force', $settings['itsec_brute_force'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_file_change'])) {
         $file_change = get_site_option('itsec_file_change');
         if (false !== $file_change && isset($file_change['last_run'])) {
             $settings['itsec_file_change']['last_run'] = $file_change['last_run'];
         } else {
             unset($settings['itsec_file_change']['last_run']);
         }
         if (false !== $file_change && isset($file_change['last_chunk'])) {
             $settings['itsec_file_change']['last_chunk'] = $file_change['last_chunk'];
         } else {
             unset($settings['itsec_file_change']['last_chunk']);
         }
         if (update_site_option('itsec_file_change', $settings['itsec_file_change'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_four_oh_four'])) {
         if (update_site_option('itsec_four_oh_four', $settings['itsec_four_oh_four'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_hide_backend'])) {
         $old_settings = get_site_option('itsec_hide_backend');
         if (update_site_option('itsec_hide_backend', $settings['itsec_hide_backend'])) {
             $input = $settings['itsec_hide_backend'];
             if ($input['slug'] !== $old_settings['slug'] || $input['register'] !== $old_settings['register'] || $input['enabled'] !== $old_settings['enabled']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             if ($input['slug'] !== $old_settings['slug'] && true === $input['enabled']) {
                 add_site_option('itsec_hide_backend_new_slug', $input['slug']);
             }
             $updated = true;
         }
     }
     if (isset($settings['itsec_ipcheck'])) {
         if (update_site_option('itsec_ipcheck', $settings['itsec_ipcheck'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_malware'])) {
         if (update_site_option('itsec_malware', $settings['itsec_malware'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_ssl'])) {
         if (update_site_option('itsec_ssl', $settings['itsec_ssl'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_strong_passwords'])) {
         if (update_site_option('itsec_strong_passwords', $settings['itsec_strong_passwords'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_tweaks'])) {
         $old_settings = get_site_option('itsec_tweaks');
         $is_safe = ITSEC_Lib::safe_jquery_version() === true;
         $raw_version = get_site_option('itsec_jquery_version');
         if (true !== $is_safe && false !== $raw_version) {
             $enable_set_safe_jquery = true;
         }
         if (!$enable_set_safe_jquery) {
             $settings['itsec_tweaks']['safe_jquery'] = 0;
         }
         if (update_site_option('itsec_tweaks', $settings['itsec_tweaks'])) {
             if ($input['protect_files'] !== $old_settings['protect_files'] || $input['directory_browsing'] !== $old_settings['directory_browsing'] || $input['request_methods'] !== $old_settings['request_methods'] || $input['suspicious_query_strings'] !== $old_settings['suspicious_query_strings'] || $input['non_english_characters'] !== $old_settings['non_english_characters'] || $input['comment_spam'] !== $old_settings['comment_spam'] || $input['disable_xmlrpc'] !== $old_settings['disable_xmlrpc'] || $input['uploads_php'] !== $old_settings['uploads_php']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             $updated = true;
         }
     }
     $site_status = array('username_admin_exists' => username_exists('admin') ? 1 : 0, 'user_id1_exists' => ITSEC_Lib::user_id_exists(1) ? 1 : 0, 'backup' => $this->backup_status(), 'permalink_structure' => get_option('permalink_structure'), 'is_multisite' => is_multisite() ? 1 : 0, 'users_can_register' => get_site_option('users_can_register') ? 1 : 0, 'force_ssl_login' => defined('FORCE_SSL_LOGIN') && FORCE_SSL_LOGIN === true ? 1 : 0, 'force_ssl_admin' => defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN === true ? 1 : 0, 'server_nginx' => ITSEC_Lib::get_server() === 'nginx' ? 1 : 0, 'lockouts_host' => $this->get_lockouts('host', true), 'lockouts_user' => $this->get_lockouts('user', true), 'lockouts_username' => $this->get_lockouts('username', true));
     $out = array();
     if ($updated) {
         $out['result'] = 'success';
     } else {
         $out['result'] = 'noupdate';
     }
     $out['site_status'] = $site_status;
     return $out;
 }
開發者ID:jexmex,項目名稱:mainwp-child,代碼行數:101,代碼來源:class-mainwp-child-ithemes-security.php

示例2: dashboard_status


//.........這裏部分代碼省略.........
				'text' => __( 'XML-RPC requests can try multiple authentication attempts per request. Attackers can use this to speed up their brute force attacks.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_server_allow_xmlrpc_multiauth',
			);
		} else {
			$status_array = 'safe-high';
			$status       = array(
				'text' => __( 'XML-RPC requests with multiple authentication attempts are blocked.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_server_allow_xmlrpc_multiauth',
			);
		}
		
		array_push( $statuses[ $status_array ], $status );

		if ( isset( $this->settings['uploads_php'] ) && $this->settings['uploads_php'] === true ) {

			$status_array = 'safe-medium';
			$status       = array(
				'text' => __( 'Users cannot execute PHP from the uploads folder.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_server_uploads_php',
			);

		} else {

			$status_array = 'medium';
			$status       = array(
				'text' => __( 'Users can execute PHP from the uploads folder.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_server_uploads_php',
			);

		}

		array_push( $statuses[ $status_array ], $status );

		$safe_jquery = ITSEC_Lib::safe_jquery_version();

		if ( $safe_jquery === true ) {

			$status_array = 'safe-high';
			$status       = array(
				'text' => __( 'The front page of your site is using a safe version of jQuery.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_wordpress_safe_jquery',
			);

		} elseif ( $safe_jquery === false ) {

			$status_array = 'high';
			$status       = array(
				'text' => __( 'The front page of your site is not using a safe version of jQuery or the version of jQuery cannot be determined.', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_wordpress_safe_jquery',
			);

		} else {

			$status_array = 'low';
			$status       = array(
				'text' => __( 'Your version of jQuery has not been determined. Load your homepage while logged in to determine the version of jQuery you are using', 'it-l10n-ithemes-security-pro' ),
				'link' => '#itsec_tweaks_wordpress_safe_jquery',
			);

		}

		array_push( $statuses[ $status_array ], $status );

		if ( isset( $this->settings['force_unique_nicename'] ) && $this->settings['force_unique_nicename'] === true ) {

			$status_array = 'safe-high';
開發者ID:helloworld-digital,項目名稱:insightvision,代碼行數:67,代碼來源:class-itsec-tweaks-admin.php

示例3: tweaks_wordpress_safe_jquery

 /**
  * echos Replace jQuery Field
  *
  * @since 4.0
  *
  * @return void
  */
 public function tweaks_wordpress_safe_jquery()
 {
     if (isset($this->settings['safe_jquery']) && $this->settings['safe_jquery'] === true) {
         $safe_jquery = 1;
     } else {
         $safe_jquery = 0;
     }
     $raw_version = get_site_option('itsec_jquery_version');
     $is_safe = ITSEC_Lib::safe_jquery_version() === true;
     if ($raw_version !== false) {
         $version = sprintf(__('Your current jQuery version is %1$s'), $raw_version);
     } else {
         $version = sprintf(__('Your current jQuery version is undetermined. Please <a href="%1$s" target="_blank">check your homepage</a> to see if you even need this feature'), site_url());
     }
     if ($is_safe === true) {
         $color = 'green';
     } else {
         $color = 'red';
     }
     if ($is_safe !== true && $raw_version !== false) {
         echo '<input type="checkbox" id="itsec_tweaks_wordpress_safe_jquery" name="itsec_tweaks[safe_jquery]" value="1" ' . checked(1, $safe_jquery, false) . '/>';
     }
     echo '<label for="itsec_tweaks_wordpress_safe_jquery">' . __('Enqueue a safe version of jQuery', 'better-wp-security') . '</label>';
     echo '<p class="description">' . __('Remove the existing jQuery version used and replace it with a safe version (the version that comes default with WordPress).', 'better-wp-security') . '</p>';
     echo '<p class="description" style="color: ' . $color . '">' . $version . '.</p>';
     printf('<p class="description">%s <a href="%s" target="_blank">%s</a> %s</p>', __('Note that this only checks the homepage of your site and only for users who are logged in. This is done intentionally to save resources. If you think this is in error ', 'better-wp-security'), site_url(), __('click here to check again.', 'better-wp-security'), __('This will open your homepage in a new window allowing the plugin to determine the version of jQuery actually being used. You can then come back here and reload this page to see your version.', 'better-wp-security'));
 }
開發者ID:quinntron,項目名稱:greendot,代碼行數:34,代碼來源:class-itsec-tweaks-admin.php


注:本文中的ITSEC_Lib::safe_jquery_version方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。