Skip to content

Commit

Permalink
v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bestwebsoft committed Aug 29, 2017
1 parent f1d0ee3 commit 73c1924
Show file tree
Hide file tree
Showing 46 changed files with 5,922 additions and 2,680 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -74,10 +74,11 @@
<li>Website tagline</li>
</ul>
</li>
<li>Change language slug position in the website URL [NEW]</li>
<li>Create separate menus for different languages</li>
<li>Display/hide widgets for different languages</li>
<li>Switch language automatically based on user’s IP</li>
<li>Add short language code version to the URL</li>
<li>Add short language slug to the URL</li>
<li>Get answer to your support question within one business day (<a href="https://bestwebsoft.com/support-policy/" rel="nofollow">Support Policy</a>)</li>
</ul>
<p><a href="https://bestwebsoft.com/products/wordpress/plugins/multilanguage/?k=1d4576a3a2c4fc0f127ce2ee0341d81b" rel="nofollow">Upgrade to Pro Now</a></p>
Expand All @@ -92,7 +93,7 @@
<p>Visit our Help Center if you have any questions, our friendly Support Team is happy to help — <a href="https://support.bestwebsoft.com/" rel="nofollow">https://support.bestwebsoft.com/</a></p>
<h4>Translation</h4>
<ul>
<li>Czech (cs_CZ) (thanks to <a href="mailto:&#105;&#110;&#102;&#111;&#064;&#x70;&#x61;&#x6d;&#x61;&#x64;&#x65;&#115;&#115;&#111;&#102;&#116;.&#x63;&#x7a;" rel="nofollow">PaMaDeSSoft</a>, www.pamadessoft.cz)</li>
<li>Czech (cs_CZ) (thanks to <a href="mailto:&#107;&#117;&#x63;&#x65;&#114;&#x61;&#x6d;&#105;&#064;&#x67;&#109;&#097;&#x69;&#108;&#046;&#x63;&#x6f;&#109;" rel="nofollow">Michal Kučera</a>, www.n0lim.it, <a href="mailto:&#105;&#110;&#102;&#111;&#064;&#x70;&#x61;&#x6d;&#x61;&#x64;&#x65;&#115;&#115;&#111;&#102;&#116;.&#x63;&#x7a;" rel="nofollow">PaMaDeSSoft</a>, www.pamadessoft.cz)</li>
<li>Polish (pl_PL) (thanks to <a href="mailto:&#101;&#x6d;&#105;&#108;&#x6a;&#111;&#x40;&#116;&#x6c;&#x65;&#110;&#x2e;&#112;&#x6c;" rel="nofollow">Emil Król</a>)</li>
<li>Russian (ru_RU)</li>
<li>Ukrainian (uk)</li>
Expand Down
66 changes: 35 additions & 31 deletions bws_menu/bws_functions.php
Expand Up @@ -4,6 +4,7 @@
*/

require( dirname( __FILE__ ) . '/deprecated.php' );
require_once( dirname( __FILE__ ) . '/deactivation-form.php' );

/**
* Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
Expand Down Expand Up @@ -55,7 +56,7 @@ function bws_menu_url( $path = '' ) {
* Function check if plugin is compatible with current WP version
* @return void
*/
if ( ! function_exists ( 'bws_wp_min_version_check' ) ) {
if ( ! function_exists( 'bws_wp_min_version_check' ) ) {
function bws_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
global $wp_version, $bws_versions_notice_array;
if ( false == $min_wp )
Expand Down Expand Up @@ -124,7 +125,7 @@ function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_na
<div class="update-message' . $div_class . '"' . $style . '>';
if ( $wp_version >= 4.6 )
echo '<p>';
echo '<strong>' . __( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . __( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using you personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/articles/204240089">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
echo '<strong>' . __( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . __( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using your personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/articles/204240089">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
if ( $wp_version >= 4.6 )
echo '</p>';
echo '</div>
Expand Down Expand Up @@ -544,7 +545,20 @@ function bws_plugins_admin_init() {
unset( $recent[ $plugin ] );
update_site_option( 'recently_activated', $recent );
}
wp_redirect( self_admin_url( 'admin.php?page=bws_panel&activate=true' ) );
/**
* @deprecated 1.9.8 (15.12.2016)
*/
$is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
$page = esc_attr( $_GET['page'] );
$tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : '';

if ( $is_main_page )
$current_page = 'admin.php?page=' . $page;
else
$current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
/*end deprecated */

wp_redirect( self_admin_url( $current_page . '&activate=true' ) );
exit();
}

Expand All @@ -559,7 +573,7 @@ function bws_plugins_admin_init() {

if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
function bws_admin_enqueue_scripts() {
global $wp_scripts;
global $wp_scripts, $hook_suffix;

$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';

Expand All @@ -574,6 +588,10 @@ function bws_admin_enqueue_scripts() {
add_thickbox();
wp_enqueue_script( 'plugin-install' );
}

if ( 'plugins.php' == $hook_suffix && ! defined( 'DOING_AJAX' ) ) {
wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
}
}
}

Expand Down Expand Up @@ -652,14 +670,24 @@ function bws_plugins_admin_head() {
),
'set_timeout' => 2000
);
if ( $wp_version < '3.9' )
$tooltip_args['css_selector'] = '.mce_add_bws_shortcode';
bws_add_tooltip_in_admin( $tooltip_args );
}
}
}
}

if ( ! function_exists ( 'bws_plugins_admin_footer' ) ) {
function bws_plugins_admin_footer() {
global $hook_suffix;

bws_shortcode_media_button_popup();

if ( 'plugins.php' == $hook_suffix && ! defined( 'DOING_AJAX' ) ) {
bws_add_deactivation_feedback_dialog_box();
}
}
}

if ( ! function_exists ( 'bws_plugins_include_codemirror' ) ) {
function bws_plugins_include_codemirror() {
wp_enqueue_style( 'codemirror.css', bws_menu_url( 'css/codemirror.css' ) );
Expand Down Expand Up @@ -847,33 +875,9 @@ function bws_shortcode_media_button_popup() {
<p><?php _e( 'The shortcode will be inserted', 'bestwebsoft' ); ?></p>
<div id="bws_shortcode_block"><div id="bws_shortcode_display"></div></div>
</div>
<?php if ( $wp_version < '3.9' ) { ?>
<p>
<button class="button-primary primary bws_shortcode_insert"><?php _e( 'Insert', 'bestwebsoft' ); ?></button>
</p>
<?php } ?>
</div>
</div>
<?php }
if ( $wp_version < '3.9' ) { ?>
<script type="text/javascript">
(function($){
$( '.bws_shortcode_insert' ).on( 'click',function() {
var shortcode = $( '#TB_ajaxContent #bws_shortcode_display' ).text();
if ( '' != shortcode ) {
/* insert shortcode to tinymce */
if ( !tinyMCE.activeEditor || tinyMCE.activeEditor.isHidden() ) {
$( 'textarea#content' ).val( shortcode );
} else {
tinyMCE.execCommand( 'mceInsertContent', false, shortcode );
}
}
/* close the thickbox after adding shortcode to editor */
self.parent.tb_remove();
});
})(jQuery);
</script>
<?php }
}
}

Expand Down Expand Up @@ -1048,7 +1052,7 @@ function bws_delete_plugin( $basename ) {
add_action( 'admin_init', 'bws_plugins_admin_init' );
add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
add_action( 'admin_head', 'bws_plugins_admin_head' );
add_action( 'admin_footer','bws_shortcode_media_button_popup' );
add_action( 'admin_footer','bws_plugins_admin_footer' );

add_action( 'admin_notices', 'bws_admin_notices', 30 );

Expand Down
3 changes: 2 additions & 1 deletion bws_menu/bws_include.php
Expand Up @@ -5,7 +5,7 @@

if ( ! function_exists ( 'bws_include_init' ) ) {
function bws_include_init( $base, $bws_menu_source = 'plugins' ) {
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_added_menu;
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_added_menu, $bstwbsftwppdtplgns_active_plugins;
if ( ! function_exists( 'get_plugin_data' ) )
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );

Expand All @@ -14,6 +14,7 @@ function bws_include_init( $base, $bws_menu_source = 'plugins' ) {

if ( $bws_menu_source == 'plugins' ) {
$bws_menu_dir = $wp_plugins_dir . '/' . dirname( $base ) . '/bws_menu/bws_menu.php';
$bstwbsftwppdtplgns_active_plugins[ $base ] = get_plugin_data( $wp_plugins_dir . '/' . $base );
} else {
$bws_menu_dir = $wp_content_dir . '/themes/' . $base . '/inc/bws_menu/bws_menu.php';
}
Expand Down
88 changes: 34 additions & 54 deletions bws_menu/bws_menu.php
@@ -1,7 +1,7 @@
<?php
/*
* Function for displaying BestWebSoft menu
* Version: 2.0.8
* Version: 2.1.3
*/

if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
Expand Down Expand Up @@ -178,7 +178,7 @@ function bws_add_menu_render() {
$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
$memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
$wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
$wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
$memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
$exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" : __( 'No', 'bestwebsoft' );
$iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
Expand All @@ -199,7 +199,7 @@ function bws_add_menu_render() {
__( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
__( 'WP Version', 'bestwebsoft' ) => $wp_version,
__( 'WP Multisite', 'bestwebsoft' ) => $multisite,
__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
__( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')'
),
),
Expand All @@ -217,7 +217,7 @@ function bws_add_menu_render() {
__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
__( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
__( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
'$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'],
'$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'],
),
Expand Down Expand Up @@ -273,8 +273,8 @@ function bws_add_menu_render() {
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
$headers .= 'From: ' . get_option( 'admin_email' );
$message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>';
foreach ( $system_info as $info ) {
if ( ! empty( $info['data'] ) ) {
foreach ( $system_info as $info ) {
if ( ! empty( $info['data'] ) ) {
$message_text .= '<h4>' . $info['name'];
if ( isset( $info['count'] ) )
$message_text .= ' (' . $info['count'] . ')';
Expand All @@ -301,7 +301,7 @@ function bws_add_menu_render() {
<span>panel</span>
</a>
</div>
<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
<div class="bws-nav-tab-wrapper">
<?php if ( $is_main_page ) { ?>
<a class="bws-nav-tab<?php if ( 'bws_panel' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
Expand Down Expand Up @@ -536,8 +536,8 @@ function bws_add_menu_render() {
</div>
<div class="bws_product_links">
<?php if ( $is_active || $is_pro_active ) {
if ( $is_pro_isset ) {
if ( ! $is_pro_installed ) {
if ( $is_pro_isset ) {
if ( ! $is_pro_installed ) {
if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
<form method="post" action="">
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
Expand Down Expand Up @@ -610,52 +610,31 @@ function bws_add_menu_render() {
require( dirname( __FILE__ ) . '/product_list.php' ); ?>
<h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
<div id="availablethemes" class="bws-availablethemes">
<?php if ( $wp_version < '3.9' ) {
foreach ( $themes as $theme ) { ?>
<div class="available-theme installable-theme"><?php
<div class="theme-browser content-filterable rendered">
<div class="themes wp-clearfix">
<?php foreach ( $themes as $key => $theme ) {
$installed_theme = wp_get_theme( $theme->slug ); ?>
<a class="screenshot" href="<?php echo esc_url( $theme->href ); ?>">
<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" width='150' />
</a>
<h3><?php echo $theme->name; ?></h3>
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
<div class="action-links">
<ul>
<?php if ( $installed_theme->exists() ) { ?>
<li><span class="install-now" title="'<?php esc_attr__( 'This theme is already installed and is up to date' ); ?>"><?php echo _x( 'Installed', 'theme', 'bestwebsoft' ); ?></span></li>
<?php } ?>
<li><a class="theme-detail" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a></li>
</ul>
</div>
</div>
<?php }
} else { ?>
<div class="theme-browser content-filterable rendered">
<div class="themes wp-clearfix">
<?php foreach ( $themes as $key => $theme ) {
$installed_theme = wp_get_theme( $theme->slug ); ?>
<div class="theme" tabindex="0">
<div class="theme-screenshot">
<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
</div>
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
<h3 class="theme-name"><?php echo $theme->name; ?></h3>
<div class="theme-actions">
<a class="button button-secondary preview install-theme-preview" href="<?php echo $theme->href; ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
</div>
<?php if ( $installed_theme->exists() ) {
if ( $wp_version < '4.6' ) { ?>
<div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
<?php } else { ?>
<div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
<?php }
} ?>
<div class="theme" tabindex="0">
<div class="theme-screenshot">
<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
</div>
<?php } ?>
<br class="clear" />
</div>
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
<h3 class="theme-name"><?php echo $theme->name; ?></h3>
<div class="theme-actions">
<a class="button button-secondary preview install-theme-preview" href="<?php echo $theme->href; ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
</div>
<?php if ( $installed_theme->exists() ) {
if ( $wp_version < '4.6' ) { ?>
<div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
<?php } else { ?>
<div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
<?php }
} ?>
</div>
<?php } ?>
<br class="clear" />
</div>
<?php } ?>
</div>
<p><a class="bws_browse_link" href="http://bestweblayout.com/categories/themes/" target="_blank"><?php _e( 'Browse Free WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
</div>
<?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?>
Expand Down Expand Up @@ -685,7 +664,7 @@ function bws_add_menu_render() {
<strong>
<?php echo $info['name'];
if ( isset( $info['count'] ) )
echo ' (' . $info['count'] . ')'; ?>
echo ' (' . $info['count'] . ')'; ?>
</strong>
</th>
</tr>
Expand All @@ -699,7 +678,7 @@ function bws_add_menu_render() {
<?php } ?>
</tbody>
</table>
<?php }
<?php }
} ?>
</div>
</div>
Expand All @@ -710,6 +689,7 @@ function bws_add_menu_render() {
function bws_get_banner_array() {
global $bstwbsftwppdtplgns_banner_array;
$bstwbsftwppdtplgns_banner_array = array(
array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
array( 'tmsht_hide_banner_on_plugin_page', 'timesheet/timesheet.php', '0.1.3' ),
array( 'pgntn_hide_banner_on_plugin_page', 'pagination/pagination.php', '1.0.6' ),
Expand Down

0 comments on commit 73c1924

Please sign in to comment.