Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/portfoli.../bws_menu
File: class-bws-settings.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Displays the content on the plugin settings page
[6] Fix | Delete
*
[7] Fix | Delete
* @package BestWebSoft
[8] Fix | Delete
* @since 1.9.8
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
[12] Fix | Delete
class Bws_Settings_Tabs {
[13] Fix | Delete
private $tabs;
[14] Fix | Delete
private $pro_plugin_is_activated = false;
[15] Fix | Delete
private $custom_code_args = array();
[16] Fix | Delete
private $bws_plugin_link = '';
[17] Fix | Delete
[18] Fix | Delete
public $plugin_basename;
[19] Fix | Delete
public $prefix;
[20] Fix | Delete
public $wp_slug;
[21] Fix | Delete
[22] Fix | Delete
public $options;
[23] Fix | Delete
public $default_options;
[24] Fix | Delete
public $is_network_options;
[25] Fix | Delete
public $plugins_info = array();
[26] Fix | Delete
public $hide_pro_tabs = false;
[27] Fix | Delete
public $demo_data;
[28] Fix | Delete
[29] Fix | Delete
public $is_pro = false;
[30] Fix | Delete
public $pro_page;
[31] Fix | Delete
public $bws_license_plugin;
[32] Fix | Delete
public $link_key;
[33] Fix | Delete
public $link_pn;
[34] Fix | Delete
public $is_trial = false;
[35] Fix | Delete
public $licenses;
[36] Fix | Delete
public $trial_days;
[37] Fix | Delete
public $bws_hide_pro_option_exist = true;
[38] Fix | Delete
[39] Fix | Delete
public $forbid_view = false;
[40] Fix | Delete
public $change_permission_attr = '';
[41] Fix | Delete
[42] Fix | Delete
public $version;
[43] Fix | Delete
public $upload_dir;
[44] Fix | Delete
public $all_plugins;
[45] Fix | Delete
public $is_multisite;
[46] Fix | Delete
[47] Fix | Delete
public $doc_link;
[48] Fix | Delete
public $doc_video_link;
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Constructor.
[52] Fix | Delete
*
[53] Fix | Delete
* The child class should call this constructor from its own constructor to override
[54] Fix | Delete
* the default $args.
[55] Fix | Delete
*
[56] Fix | Delete
* @access public
[57] Fix | Delete
*
[58] Fix | Delete
* @param array|string $args
[59] Fix | Delete
*/
[60] Fix | Delete
public function __construct( $args = array() ) {
[61] Fix | Delete
global $wp_version;
[62] Fix | Delete
[63] Fix | Delete
$args = wp_parse_args(
[64] Fix | Delete
$args,
[65] Fix | Delete
array(
[66] Fix | Delete
'plugin_basename' => '',
[67] Fix | Delete
'prefix' => '',
[68] Fix | Delete
'plugins_info' => array(),
[69] Fix | Delete
'default_options' => array(),
[70] Fix | Delete
'options' => array(),
[71] Fix | Delete
'is_network_options' => false,
[72] Fix | Delete
'tabs' => array(),
[73] Fix | Delete
'doc_link' => '',
[74] Fix | Delete
'doc_video_link' => '',
[75] Fix | Delete
'wp_slug' => '',
[76] Fix | Delete
'demo_data' => false,
[77] Fix | Delete
/* if this is free version and pro exist */
[78] Fix | Delete
'link_key' => '',
[79] Fix | Delete
'link_pn' => '',
[80] Fix | Delete
'trial_days' => false,
[81] Fix | Delete
'licenses' => array(),
[82] Fix | Delete
)
[83] Fix | Delete
);
[84] Fix | Delete
[85] Fix | Delete
$args['plugins_info']['Name'] = str_replace( ' by BestWebSoft', '', $args['plugins_info']['Name'] );
[86] Fix | Delete
[87] Fix | Delete
$this->plugin_basename = $args['plugin_basename'];
[88] Fix | Delete
$this->prefix = $args['prefix'];
[89] Fix | Delete
$this->plugins_info = $args['plugins_info'];
[90] Fix | Delete
$this->options = $args['options'];
[91] Fix | Delete
$this->default_options = $args['default_options'];
[92] Fix | Delete
$this->wp_slug = $args['wp_slug'];
[93] Fix | Delete
$this->demo_data = $args['demo_data'];
[94] Fix | Delete
[95] Fix | Delete
$this->tabs = $args['tabs'];
[96] Fix | Delete
$this->is_network_options = $args['is_network_options'];
[97] Fix | Delete
[98] Fix | Delete
$this->doc_link = $args['doc_link'];
[99] Fix | Delete
$this->doc_video_link = $args['doc_video_link'];
[100] Fix | Delete
[101] Fix | Delete
$this->link_key = $args['link_key'];
[102] Fix | Delete
$this->link_pn = $args['link_pn'];
[103] Fix | Delete
$this->trial_days = $args['trial_days'];
[104] Fix | Delete
$this->licenses = $args['licenses'];
[105] Fix | Delete
[106] Fix | Delete
$this->pro_page = '';
[107] Fix | Delete
$this->bws_license_plugin = '';
[108] Fix | Delete
/* get $bws_plugins */
[109] Fix | Delete
require dirname( __FILE__ ) . '/product_list.php';
[110] Fix | Delete
if ( isset( $bws_plugins[ $this->plugin_basename ] ) ) {
[111] Fix | Delete
if ( isset( $bws_plugins[ $this->plugin_basename ]['pro_settings'] ) ) {
[112] Fix | Delete
$this->pro_page = $bws_plugins[ $this->plugin_basename ]['pro_settings'];
[113] Fix | Delete
$this->bws_license_plugin = $bws_plugins[ $this->plugin_basename ]['pro_version'];
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
$this->bws_plugin_link = substr( $bws_plugins[ $this->plugin_basename ]['link'], 0, strpos( $bws_plugins[ $this->plugin_basename ]['link'], '?' ) );
[117] Fix | Delete
[118] Fix | Delete
if ( ! empty( $this->link_key ) && ! empty( $this->link_pn ) ) {
[119] Fix | Delete
$this->bws_plugin_link .= '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info['Version'] . '&wp_v=' . $wp_version;
[120] Fix | Delete
}
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
$this->hide_pro_tabs = bws_hide_premium_options_check( $this->options );
[124] Fix | Delete
$this->version = '1.0.0';
[125] Fix | Delete
$this->is_multisite = is_multisite();
[126] Fix | Delete
[127] Fix | Delete
if ( empty( $this->pro_page ) && array_key_exists( 'license', $this->tabs ) ) {
[128] Fix | Delete
$this->is_pro = true;
[129] Fix | Delete
$this->licenses[ $this->plugins_info['TextDomain'] ] = array(
[130] Fix | Delete
'name' => $this->plugins_info['Name'],
[131] Fix | Delete
'slug' => $this->plugins_info['TextDomain'],
[132] Fix | Delete
'basename' => $this->plugin_basename,
[133] Fix | Delete
);
[134] Fix | Delete
} else {
[135] Fix | Delete
$this->licenses[ $this->plugins_info['TextDomain'] ] = array(
[136] Fix | Delete
'name' => $this->plugins_info['Name'],
[137] Fix | Delete
'slug' => $this->plugins_info['TextDomain'],
[138] Fix | Delete
'pro_slug' => substr( $this->bws_license_plugin, 0, stripos( $this->bws_license_plugin, '/' ) ),
[139] Fix | Delete
'basename' => $this->plugin_basename,
[140] Fix | Delete
'pro_basename' => $this->bws_license_plugin,
[141] Fix | Delete
);
[142] Fix | Delete
}
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
/**
[146] Fix | Delete
* Displays the content of the "Settings" on the plugin settings page
[147] Fix | Delete
*
[148] Fix | Delete
* @access public
[149] Fix | Delete
* @param void
[150] Fix | Delete
* @return void
[151] Fix | Delete
*/
[152] Fix | Delete
public function display_content() {
[153] Fix | Delete
global $bstwbsftwppdtplgns_options;
[154] Fix | Delete
if ( array_key_exists( 'custom_code', $this->tabs ) ) {
[155] Fix | Delete
/* get args for `custom code` tab */
[156] Fix | Delete
$this->get_custom_code();
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
$save_results = $this->save_all_tabs_options();
[160] Fix | Delete
[161] Fix | Delete
$this->display_messages( $save_results );
[162] Fix | Delete
if ( isset( $_REQUEST['bws_restore_default'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
[163] Fix | Delete
bws_form_restore_default_confirm( $this->plugin_basename );
[164] Fix | Delete
} elseif ( isset( $_POST['bws_handle_demo'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
[165] Fix | Delete
$this->demo_data->bws_demo_confirm();
[166] Fix | Delete
} else {
[167] Fix | Delete
bws_show_settings_notice(); ?>
[168] Fix | Delete
<form class="bws_form" method="post" action="" enctype="multipart/form-data">
[169] Fix | Delete
<div id="poststuff">
[170] Fix | Delete
<div id="post-body" class="metabox-holder columns-2">
[171] Fix | Delete
<div id="post-body-content" style="position: relative;">
[172] Fix | Delete
<?php $this->display_tabs(); ?>
[173] Fix | Delete
</div><!-- #post-body-content -->
[174] Fix | Delete
<div id="postbox-container-1" class="postbox-container">
[175] Fix | Delete
<div class="meta-box-sortables ui-sortable">
[176] Fix | Delete
<div id="submitdiv" class="postbox">
[177] Fix | Delete
<h3 class="hndle"><?php esc_html_e( 'Information', 'bestwebsoft' ); ?></h3>
[178] Fix | Delete
<div class="inside">
[179] Fix | Delete
<div class="submitbox" id="submitpost">
[180] Fix | Delete
<div id="minor-publishing">
[181] Fix | Delete
<div id="misc-publishing-actions">
[182] Fix | Delete
<?php
[183] Fix | Delete
/**
[184] Fix | Delete
* Action - Display additional content for #misc-publishing-actions
[185] Fix | Delete
*/
[186] Fix | Delete
do_action( __CLASS__ . '_information_postbox_top' );
[187] Fix | Delete
?>
[188] Fix | Delete
<?php
[189] Fix | Delete
if ( $this->is_pro ) {
[190] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $this->plugin_basename ] ) || empty( $bstwbsftwppdtplgns_options['time_out'] ) || ! array_key_exists( $this->plugin_basename, $bstwbsftwppdtplgns_options['time_out'] ) ) {
[191] Fix | Delete
$license_type = 'Pro';
[192] Fix | Delete
$license_status = __( 'Inactive', 'bestwebsoft' ) . ' <a href="#' . $this->prefix . '_license_tab" class="bws_trigger_tab_click">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
[193] Fix | Delete
} else {
[194] Fix | Delete
$finish = strtotime( $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] );
[195] Fix | Delete
$today = strtotime( gmdate( 'm/d/Y' ) );
[196] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['trial'][ $this->plugin_basename ] ) ) {
[197] Fix | Delete
$license_type = 'Trial Pro';
[198] Fix | Delete
[199] Fix | Delete
if ( $finish < $today ) {
[200] Fix | Delete
$license_status = __( 'Expired', 'bestwebsoft' );
[201] Fix | Delete
} else {
[202] Fix | Delete
$daysleft = floor( ( $finish - $today ) / ( 60 * 60 * 24 ) );
[203] Fix | Delete
$license_status = sprintf( __( '%s day(-s) left', 'bestwebsoft' ), $daysleft );
[204] Fix | Delete
}
[205] Fix | Delete
$license_status .= '. <a target="_blank" href="' . esc_url( $this->plugins_info['PluginURI'] ) . '">' . __( 'Upgrade to Pro', 'bestwebsoft' ) . '</a>';
[206] Fix | Delete
} else {
[207] Fix | Delete
$license_type = isset( $bstwbsftwppdtplgns_options['nonprofit'][ $this->plugin_basename ] ) ? 'Nonprofit Pro' : 'Pro';
[208] Fix | Delete
if ( ! empty( $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] ) && $finish < $today ) {
[209] Fix | Delete
$license_status = sprintf( __( 'Expired on %s', 'bestwebsoft' ), $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] ) . '. <a target="_blank" href="https://support.bestwebsoft.com/entries/53487136">' . __( 'Renew Now', 'bestwebsoft' ) . '</a>';
[210] Fix | Delete
} else {
[211] Fix | Delete
$license_status = __( 'Active', 'bestwebsoft' );
[212] Fix | Delete
}
[213] Fix | Delete
}
[214] Fix | Delete
}
[215] Fix | Delete
?>
[216] Fix | Delete
<div class="misc-pub-section">
[217] Fix | Delete
<strong><?php esc_html_e( 'License', 'bestwebsoft' ); ?>:</strong> <?php echo esc_attr( $license_type ); ?>
[218] Fix | Delete
</div>
[219] Fix | Delete
<div class="misc-pub-section">
[220] Fix | Delete
<strong><?php esc_html_e( 'Status', 'bestwebsoft' ); ?>:</strong> <?php echo wp_kses_post( $license_status ); ?>
[221] Fix | Delete
</div><!-- .misc-pub-section -->
[222] Fix | Delete
<?php } ?>
[223] Fix | Delete
<div class="misc-pub-section">
[224] Fix | Delete
<strong><?php esc_html_e( 'Version', 'bestwebsoft' ); ?>:</strong> <?php echo esc_attr( $this->plugins_info['Version'] ); ?>
[225] Fix | Delete
</div><!-- .misc-pub-section -->
[226] Fix | Delete
<?php
[227] Fix | Delete
/**
[228] Fix | Delete
* Action - Display additional content for #misc-publishing-actions
[229] Fix | Delete
*/
[230] Fix | Delete
do_action( __CLASS__ . '_information_postbox_bottom' );
[231] Fix | Delete
?>
[232] Fix | Delete
</div>
[233] Fix | Delete
<div class="clear"></div>
[234] Fix | Delete
</div>
[235] Fix | Delete
<div id="major-publishing-actions">
[236] Fix | Delete
<div id="publishing-action">
[237] Fix | Delete
<input type="hidden" name="<?php echo esc_attr( $this->prefix ); ?>_form_submit" value="submit" />
[238] Fix | Delete
<input id="bws-submit-button" type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?>" />
[239] Fix | Delete
<?php wp_nonce_field( $this->plugin_basename, 'bws_nonce_name' ); ?>
[240] Fix | Delete
</div>
[241] Fix | Delete
<div class="clear"></div>
[242] Fix | Delete
</div>
[243] Fix | Delete
</div>
[244] Fix | Delete
</div>
[245] Fix | Delete
</div>
[246] Fix | Delete
<?php
[247] Fix | Delete
/**
[248] Fix | Delete
* Action - Display custom metabox
[249] Fix | Delete
*/
[250] Fix | Delete
do_action( __CLASS__ . '_display_metabox' );
[251] Fix | Delete
[252] Fix | Delete
if ( function_exists( 'bws_affiliate_postbox' ) ) {
[253] Fix | Delete
bws_affiliate_postbox();
[254] Fix | Delete
}
[255] Fix | Delete
?>
[256] Fix | Delete
</div>
[257] Fix | Delete
</div>
[258] Fix | Delete
<div id="postbox-container-2" class="postbox-container">
[259] Fix | Delete
<?php
[260] Fix | Delete
/**
[261] Fix | Delete
* Action - Display additional content for #postbox-container-2
[262] Fix | Delete
*/
[263] Fix | Delete
do_action( __CLASS__ . '_display_second_postbox' );
[264] Fix | Delete
?>
[265] Fix | Delete
<div class="submit">
[266] Fix | Delete
<input type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?>" />
[267] Fix | Delete
<?php wp_nonce_field( $this->plugin_basename, 'bws_nonce_name' ); ?>
[268] Fix | Delete
</div>
[269] Fix | Delete
<?php
[270] Fix | Delete
if ( ! empty( $this->wp_slug ) ) {
[271] Fix | Delete
bws_plugin_reviews_block( $this->plugins_info['Name'], $this->wp_slug );
[272] Fix | Delete
}
[273] Fix | Delete
?>
[274] Fix | Delete
</div>
[275] Fix | Delete
</div>
[276] Fix | Delete
</form>
[277] Fix | Delete
</div>
[278] Fix | Delete
<?php
[279] Fix | Delete
}
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
/**
[283] Fix | Delete
* Displays the Tabs
[284] Fix | Delete
*
[285] Fix | Delete
* @access public
[286] Fix | Delete
* @param void
[287] Fix | Delete
* @return void
[288] Fix | Delete
*/
[289] Fix | Delete
public function display_tabs() {
[290] Fix | Delete
?>
[291] Fix | Delete
<div id="bws_settings_tabs_wrapper">
[292] Fix | Delete
<ul id="bws_settings_tabs">
[293] Fix | Delete
<?php $this->display_tabs_list(); ?>
[294] Fix | Delete
</ul>
[295] Fix | Delete
<?php $this->display_tabs_content(); ?>
[296] Fix | Delete
<div class="clear"></div>
[297] Fix | Delete
<input type="hidden" name="bws_active_tab" value="<?php
[298] Fix | Delete
if ( isset( $_REQUEST['bws_active_tab'] ) ) {
[299] Fix | Delete
echo esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['bws_active_tab'] ) ) );
[300] Fix | Delete
}
[301] Fix | Delete
?>" />
[302] Fix | Delete
</div>
[303] Fix | Delete
<?php
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
/**
[307] Fix | Delete
* Displays the list of tabs
[308] Fix | Delete
*
[309] Fix | Delete
* @access private
[310] Fix | Delete
* @return void
[311] Fix | Delete
*/
[312] Fix | Delete
private function display_tabs_list() {
[313] Fix | Delete
foreach ( $this->tabs as $tab_slug => $data ) {
[314] Fix | Delete
if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs ) {
[315] Fix | Delete
continue;
[316] Fix | Delete
}
[317] Fix | Delete
$tab_class = 'bws-tab-' . $tab_slug;
[318] Fix | Delete
if ( ! empty( $data['is_pro'] ) ) {
[319] Fix | Delete
$tab_class .= ' bws_pro_tab';
[320] Fix | Delete
}
[321] Fix | Delete
if ( ! empty( $data['class'] ) ) {
[322] Fix | Delete
$tab_class .= ' ' . $data['class'];
[323] Fix | Delete
}
[324] Fix | Delete
?>
[325] Fix | Delete
<li class="<?php echo esc_attr( $tab_class ); ?>" data-slug="<?php echo esc_attr( $tab_slug ); ?>">
[326] Fix | Delete
<a href="#<?php echo esc_attr( $this->prefix ); ?>_<?php echo esc_attr( $tab_slug ); ?>_tab">
[327] Fix | Delete
<span><?php echo esc_html( $data['label'] ); ?></span>
[328] Fix | Delete
</a>
[329] Fix | Delete
</li>
[330] Fix | Delete
<?php
[331] Fix | Delete
}
[332] Fix | Delete
}
[333] Fix | Delete
[334] Fix | Delete
/**
[335] Fix | Delete
* Displays the content of tabs
[336] Fix | Delete
*
[337] Fix | Delete
* @access private
[338] Fix | Delete
*/
[339] Fix | Delete
public function display_tabs_content() {
[340] Fix | Delete
foreach ( $this->tabs as $tab_slug => $data ) {
[341] Fix | Delete
if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs ) {
[342] Fix | Delete
continue;
[343] Fix | Delete
}
[344] Fix | Delete
?>
[345] Fix | Delete
<div class="bws_tab ui-tabs-panel ui-widget-content ui-corner-bottom" id="<?php echo esc_attr( $this->prefix . '_' . $tab_slug . '_tab' ); ?>" aria-labelledby="ui-id-2" role="tabpanel" aria-hidden="false" style="display: block;">
[346] Fix | Delete
<?php
[347] Fix | Delete
$tab_slug = str_replace( '-', '_', $tab_slug );
[348] Fix | Delete
if ( method_exists( $this, 'tab_' . $tab_slug ) ) {
[349] Fix | Delete
call_user_func( array( $this, 'tab_' . $tab_slug ) );
[350] Fix | Delete
do_action_ref_array( __CLASS__ . '_after_tab_' . $tab_slug, array( &$this ) );
[351] Fix | Delete
}
[352] Fix | Delete
?>
[353] Fix | Delete
</div>
[354] Fix | Delete
<?php
[355] Fix | Delete
}
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
/**
[359] Fix | Delete
* Save all options from all tabs and display errors\messages
[360] Fix | Delete
*
[361] Fix | Delete
* @access public
[362] Fix | Delete
* @return array
[363] Fix | Delete
*/
[364] Fix | Delete
public function save_all_tabs_options() {
[365] Fix | Delete
$message = '';
[366] Fix | Delete
$notice = '';
[367] Fix | Delete
$error = '';
[368] Fix | Delete
/* Restore default settings */
[369] Fix | Delete
if ( isset( $_POST['bws_restore_confirm'] ) && check_admin_referer( $this->plugin_basename, 'bws_settings_nonce_name' ) ) {
[370] Fix | Delete
$this->restore_options();
[371] Fix | Delete
$message = __( 'All plugin settings were restored.', 'bestwebsoft' );
[372] Fix | Delete
/* Go Pro - check license key */
[373] Fix | Delete
} elseif ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
[374] Fix | Delete
$result = $this->save_options_license_key();
[375] Fix | Delete
if ( ! empty( $result['empty_field_error'] ) ) {
[376] Fix | Delete
$error = $result['empty_field_error'];
[377] Fix | Delete
}
[378] Fix | Delete
if ( ! empty( $result['error'] ) ) {
[379] Fix | Delete
$error = $result['error'];
[380] Fix | Delete
}
[381] Fix | Delete
if ( ! empty( $result['message'] ) ) {
[382] Fix | Delete
$message = $result['message'];
[383] Fix | Delete
}
[384] Fix | Delete
if ( ! empty( $result['notice'] ) ) {
[385] Fix | Delete
$notice = $result['notice'];
[386] Fix | Delete
}
[387] Fix | Delete
/* check demo data */
[388] Fix | Delete
} else {
[389] Fix | Delete
$demo_result = ! empty( $this->demo_data ) ? $this->demo_data->bws_handle_demo_data() : false;
[390] Fix | Delete
if ( false !== $demo_result ) {
[391] Fix | Delete
if ( ! empty( $demo_result ) && is_array( $demo_result ) ) {
[392] Fix | Delete
$error = $demo_result['error'];
[393] Fix | Delete
$message = $demo_result['done'];
[394] Fix | Delete
if ( ! empty( $demo_result['done'] ) && ! empty( $demo_result['options'] ) ) {
[395] Fix | Delete
$this->options = $demo_result['options'];
[396] Fix | Delete
}
[397] Fix | Delete
}
[398] Fix | Delete
/* Save options */
[399] Fix | Delete
} elseif ( ! isset( $_REQUEST['bws_restore_default'] ) && ! isset( $_POST['bws_handle_demo'] ) && isset( $_REQUEST[ $this->prefix . '_form_submit' ] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
[400] Fix | Delete
/* save tabs */
[401] Fix | Delete
$result = $this->save_options();
[402] Fix | Delete
if ( ! empty( $result['error'] ) ) {
[403] Fix | Delete
$error = $result['error'];
[404] Fix | Delete
}
[405] Fix | Delete
if ( ! empty( $result['message'] ) ) {
[406] Fix | Delete
$message = $result['message'];
[407] Fix | Delete
}
[408] Fix | Delete
if ( ! empty( $result['notice'] ) ) {
[409] Fix | Delete
$notice = $result['notice'];
[410] Fix | Delete
}
[411] Fix | Delete
[412] Fix | Delete
if ( '' === $this->change_permission_attr ) {
[413] Fix | Delete
/* save `misc` tab */
[414] Fix | Delete
$result = $this->save_options_misc();
[415] Fix | Delete
if ( ! empty( $result['notice'] ) ) {
[416] Fix | Delete
$notice .= $result['notice'];
[417] Fix | Delete
}
[418] Fix | Delete
}
[419] Fix | Delete
}
[420] Fix | Delete
}
[421] Fix | Delete
[422] Fix | Delete
return compact( 'message', 'notice', 'error' );
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
/**
[426] Fix | Delete
* Display error\message\notice
[427] Fix | Delete
*
[428] Fix | Delete
* @access public
[429] Fix | Delete
* @param $save_results - array with error\message\notice
[430] Fix | Delete
* @return void
[431] Fix | Delete
*/
[432] Fix | Delete
public function display_messages( $save_results ) {
[433] Fix | Delete
/**
[434] Fix | Delete
* Action - Display custom error\message\notice
[435] Fix | Delete
*/
[436] Fix | Delete
do_action( __CLASS__ . '_display_custom_messages', $save_results );
[437] Fix | Delete
?>
[438] Fix | Delete
<div class="updated fade inline"
[439] Fix | Delete
<?php
[440] Fix | Delete
if ( empty( $save_results['message'] ) ) {
[441] Fix | Delete
echo 'style="display:none"';
[442] Fix | Delete
}
[443] Fix | Delete
?>
[444] Fix | Delete
><p><strong><?php echo ! empty( $save_results['message'] ) ? wp_kses_post( $save_results['message'] ) : ''; ?></strong></p></div>
[445] Fix | Delete
<div class="updated bws-notice inline"
[446] Fix | Delete
<?php
[447] Fix | Delete
if ( empty( $save_results['notice'] ) ) {
[448] Fix | Delete
echo 'style="display:none"';
[449] Fix | Delete
}
[450] Fix | Delete
?>
[451] Fix | Delete
><p><strong><?php echo ! empty( $save_results['notice'] ) ? wp_kses_post( $save_results['notice'] ) : ''; ?></strong></p></div>
[452] Fix | Delete
<div class="error inline"
[453] Fix | Delete
<?php
[454] Fix | Delete
if ( empty( $save_results['error'] ) ) {
[455] Fix | Delete
echo 'style="display:none"';
[456] Fix | Delete
}
[457] Fix | Delete
?>
[458] Fix | Delete
><p><strong><?php echo ! empty( $save_results['error'] ) ? wp_kses_post( $save_results['error'] ) : ''; ?></strong></p></div>
[459] Fix | Delete
<?php
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
/**
[463] Fix | Delete
* Save plugin options to the database
[464] Fix | Delete
*
[465] Fix | Delete
* @access public
[466] Fix | Delete
* @param ab
[467] Fix | Delete
* @abstract
[468] Fix | Delete
*/
[469] Fix | Delete
public function save_options() {
[470] Fix | Delete
die( 'function Bws_Settings_Tabs::save_options() must be over-ridden in a sub-class.' );
[471] Fix | Delete
}
[472] Fix | Delete
[473] Fix | Delete
/**
[474] Fix | Delete
* Get 'custom_code' status and content
[475] Fix | Delete
*
[476] Fix | Delete
* @access private
[477] Fix | Delete
*/
[478] Fix | Delete
private function get_custom_code() {
[479] Fix | Delete
global $bstwbsftwppdtplgns_options, $wp_filesystem;
[480] Fix | Delete
[481] Fix | Delete
$this->custom_code_args = array(
[482] Fix | Delete
'is_css_active' => false,
[483] Fix | Delete
'content_css' => '',
[484] Fix | Delete
'css_writeable' => false,
[485] Fix | Delete
'is_php_active' => false,
[486] Fix | Delete
'content_php' => '',
[487] Fix | Delete
'php_writeable' => false,
[488] Fix | Delete
'is_js_active' => false,
[489] Fix | Delete
'content_js' => '',
[490] Fix | Delete
'js_writeable' => false,
[491] Fix | Delete
);
[492] Fix | Delete
[493] Fix | Delete
if ( ! $this->upload_dir ) {
[494] Fix | Delete
$this->upload_dir = wp_upload_dir();
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
$folder = $this->upload_dir['basedir'] . '/bws-custom-code';
[498] Fix | Delete
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function