当前位置: 首页>>代码示例>>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;未经允许,请勿转载。