本文整理汇总了PHP中ITSEC_Core::get_plugin_build方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Core::get_plugin_build方法的具体用法?PHP ITSEC_Core::get_plugin_build怎么用?PHP ITSEC_Core::get_plugin_build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITSEC_Core
的用法示例。
在下文中一共展示了ITSEC_Core::get_plugin_build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade_execute
/**
* Update Execution
*
* @since 4.0
*
* @param string $old_version Old version number
*
* @return void
*/
private function upgrade_execute($upgrade = false)
{
global $itsec_old_version, $itsec_globals, $wpdb, $itsec_setup_action;
$tables_updated = false;
$itsec_setup_action = 'upgrade';
$itsec_old_version = $upgrade;
if ($itsec_old_version < 4000) {
global $itsec_bwps_options;
if (wp_next_scheduled('bwps_backup')) {
wp_clear_scheduled_hook('bwps_backup');
}
if (is_multisite()) {
switch_to_blog(1);
$itsec_bwps_options = get_option('bit51_bwps');
delete_option('bit51_bwps');
delete_option('bwps_intrusion_warning');
delete_option('bit51_bwps_data');
delete_site_transient('bit51_bwps_backup');
delete_site_transient('bwps_away');
restore_current_blog();
} else {
$itsec_bwps_options = get_option('bit51_bwps');
delete_option('bit51_bwps');
delete_option('bwps_intrusion_warning');
delete_option('bit51_bwps_data');
delete_site_transient('bit51_bwps_backup');
delete_site_transient('bwps_away');
}
if ($itsec_bwps_options !== false) {
$current_options = get_site_option('itsec_global');
if ($current_options === false) {
$current_options = $this->defaults;
}
$current_options['notification_email'] = array(isset($itsec_bwps_options['ll_emailaddress']) && strlen($itsec_bwps_options['ll_emailaddress']) ? $itsec_bwps_options['ll_emailaddress'] : get_option('admin_email'));
$current_options['backup_email'] = array(isset($itsec_bwps_options['backup_emailaddress']) && strlen($itsec_bwps_options['backup_emailaddress']) ? $itsec_bwps_options['backup_emailaddress'] : get_option('admin_email'));
$current_options['blacklist'] = isset($itsec_bwps_options['ll_blacklistip']) && $itsec_bwps_options['ll_blacklistip'] == 0 ? false : true;
$current_options['blacklist_count'] = isset($itsec_bwps_options['ll_blacklistipthreshold']) && intval($itsec_bwps_options['ll_blacklistipthreshold']) > 0 ? intval($itsec_bwps_options['ll_blacklistipthreshold']) : 3;
$current_options['write_files'] = isset($itsec_bwps_options['st_writefiles']) && $itsec_bwps_options['st_writefiles'] == 1 ? true : false;
$itsec_globals['settings']['write_files'] = $current_options['write_files'];
$current_options['did_upgrade'] = true;
if (isset($itsec_bwps_options['id_whitelist']) && !is_array($itsec_bwps_options['id_whitelist']) && strlen($itsec_bwps_options['id_whitelist']) > 1) {
$raw_hosts = explode(PHP_EOL, $itsec_bwps_options['id_whitelist']);
foreach ($raw_hosts as $host) {
if (strlen($host) > 1) {
$current_options['lockout_white_list'][] = $host;
}
}
}
if ($current_options['write_files'] === false) {
set_site_transient('ITSEC_SHOW_WRITE_FILES_TOOLTIP', true, 600);
}
update_site_option('itsec_global', $current_options);
}
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "bwps_lockouts`;");
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "bwps_log`;");
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "BWPS_d404`;");
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "BWPS_ll`;");
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "BWPS_lockouts`;");
delete_option('bwps_file_log');
delete_option('bwps_awaymode');
delete_option('bwps_filecheck');
delete_option('BWPS_Login_Slug');
delete_option('BWPS_options');
delete_option('BWPS_versions');
delete_option('bit51_bwps_data');
}
$this->do_modules();
$itsec_globals['data']['build'] = ITSEC_Core::get_plugin_build();
update_site_option('itsec_data', $itsec_globals['data']);
if ($itsec_old_version < 4030) {
ITSEC_Lib::create_database_tables();
//adds username field to lockouts and temp
$tables_updated = true;
ITSEC_Response::regenerate_server_config();
}
if ($itsec_old_version < 4031) {
$banned_option = get_site_option('itsec_ban_users');
if (isset($banned_option['white_list'])) {
$banned_white_list = $banned_option['white_list'];
$options = get_site_option('itsec_global');
$white_list = isset($options['lockout_white_list']) ? $options['lockout_white_list'] : array();
if (!is_array($white_list)) {
$white_list = explode(PHP_EOL, $white_list);
}
if (!is_array($banned_white_list)) {
$banned_white_list = explode(PHP_EOL, $banned_white_list);
}
$new_white_list = array_merge($white_list, $banned_white_list);
$options['lockout_white_list'] = $new_white_list;
update_site_option('itsec_global', $options);
}
//.........这里部分代码省略.........
示例2: _e
<li><?php
_e('Content Directory', 'better-wp-security');
?>
: <strong><?php
echo WP_CONTENT_DIR;
?>
</strong></li>
</ul>
</li>
<li>
<h4><?php
echo $itsec_globals['plugin_name'] . __(' variables', 'better-wp-security');
?>
</h4>
<ul>
<li><?php
_e('Build Version', 'better-wp-security');
?>
: <strong><?php
echo ITSEC_Core::get_plugin_build();
?>
</strong><br/>
<em><?php
_e('Note: this is NOT the same as the version number on the plugin page or WordPress.org page and is instead used for support.', 'better-wp-security');
?>
</em>
</li>
</ul>
</li>
</ul>