function gglcptch_init() { global $gglcptch_options, $gglcptch_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($gglcptch_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gglcptch_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $gglcptch_plugin_info, '3.8', '3.1'); /* Get options from the database */ $gglcptch_options = get_option('gglcptch_options'); if (!$gglcptch_options) { register_gglcptch_settings(); $gglcptch_options = get_option('gglcptch_options'); } /* Add hooks */ if ('1' == $gglcptch_options['login_form'] || '1' == $gglcptch_options['reset_pwd_form'] || '1' == $gglcptch_options['registration_form']) { add_action('login_enqueue_scripts', 'gglcptch_add_site_script_styles'); if ('1' == $gglcptch_options['login_form']) { add_action('login_form', 'gglcptch_login_display'); add_action('authenticate', 'gglcptch_login_check', 21, 1); } if ('1' == $gglcptch_options['comments_form']) { add_action('comment_form_after_fields', 'gglcptch_commentform_display'); add_action('comment_form_logged_in_after', 'gglcptch_commentform_display'); add_action('pre_comment_on_post', 'gglcptch_commentform_check'); } if ('1' == $gglcptch_options['reset_pwd_form']) { add_action('lostpassword_form', 'gglcptch_login_display'); add_action('lostpassword_post', 'gglcptch_lostpassword_check'); } if ('1' == $gglcptch_options['registration_form']) { if (!is_multisite()) { add_action('register_form', 'gglcptch_login_display'); add_action('register_post', 'gglcptch_lostpassword_check'); } else { add_action('signup_extra_fields', 'gglcptch_signup_display'); add_filter('wpmu_validate_user_signup', 'gglcptch_signup_check', 10, 3); } } } if ('1' == $gglcptch_options['contact_form']) { add_filter('cntctfrm_display_captcha', 'gglcptch_cf_display'); add_filter('cntctfrmpr_display_captcha', 'gglcptch_cf_display'); } }
function gglcptch_init() { global $gglcptch_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($gglcptch_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gglcptch_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $gglcptch_plugin_info, '3.8', '3.1'); }
function gllr_init() { global $gllr_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (!$gllr_plugin_info) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gllr_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $gllr_plugin_info, '3.8', '3.5'); /* Register post type */ gllr_post_type_images(); }
function pgntn_init() { global $bws_plugin_info, $pgntn_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); /* Add variable for bws_menu */ if (empty($pgntn_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $pgntn_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $pgntn_plugin_info, '3.8', '3.3'); pgntn_settings(); pgntn_display(); }
function vstrsnln_plugin_init() { global $vstrsnln_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($vstrsnln_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $vstrsnln_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $vstrsnln_plugin_info, '3.8', '3.4'); /* Get/Register and check settings for plugin */ vstrsnln_default_options(); vstrsnln_write_user_base(); }
function cstmfldssrch_init() { global $cstmfldssrch_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($cstmfldssrch_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $cstmfldssrch_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $cstmfldssrch_plugin_info, '3.8', '3.1'); /* Call register settings function */ if (!is_admin() || isset($_GET['page']) && "custom-fields-search.php" == $_GET['page']) { cstmfldssrch_register_options(); } }
function gglnltcs_init() { global $gglnltcs_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($gglnltcs_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gglnltcs_plugin_info = get_plugin_data(__FILE__); } /* Check if plugin is compatible with current WP version.*/ bws_wp_min_version_check(plugin_basename(__FILE__), $gglnltcs_plugin_info, '3.8', '3.3'); /* Load options only on the frontend or on the plugin page. */ if (!is_admin() || isset($_REQUEST['page']) && "bws-google-analytics.php" == $_REQUEST['page']) { gglnltcs_get_options_from_db(); } }
function pplrpsts_init() { global $pplrpsts_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($pplrpsts_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $pplrpsts_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $pplrpsts_plugin_info, '3.8', '3.1'); if (!session_id()) { @session_start(); } add_image_size('popular-post-featured-image', 60, 60, true); }
function gglcptch_init() { global $gglcptch_options, $gglcptch_allow_url_fopen, $gglcptch_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($gglcptch_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gglcptch_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $gglcptch_plugin_info, '3.8', '3.1'); /* Get options from the database */ $gglcptch_options = get_option('gglcptch_options'); /* Get option from the php.ini */ $gglcptch_allow_url_fopen = ini_get('allow_url_fopen') != 1 ? false : true; /* Add hooks */ if ('1' == $gglcptch_options['login_form']) { add_action('login_form', 'gglcptch_login_display'); add_action('authenticate', 'gglcptch_login_check', 21, 1); } if ('1' == $gglcptch_options['comments_form']) { add_action('comment_form_after_fields', 'gglcptch_commentform_display'); add_action('comment_form_logged_in_after', 'gglcptch_commentform_display'); add_action('pre_comment_on_post', 'gglcptch_commentform_check'); } if ('1' == $gglcptch_options['reset_pwd_form']) { add_action('lostpassword_form', 'gglcptch_login_display'); add_action('lostpassword_post', 'gglcptch_lostpassword_check'); } if ('1' == $gglcptch_options['registration_form']) { add_action('register_form', 'gglcptch_login_display'); add_action('register_post', 'gglcptch_lostpassword_check'); /* for multisite */ add_action('signup_extra_fields', 'gglcptch_login_display'); } if ('1' == $gglcptch_options['contact_form']) { add_filter('cntctfrm_display_captcha', 'gglcptch_cf_display'); add_filter('cntctfrmpr_display_captcha', 'gglcptch_cf_display'); } }
function cntctfrm_init() { global $bws_plugin_info, $cntctfrm_plugin_info; if (!session_id()) { @session_start(); } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($cntctfrm_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $cntctfrm_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $cntctfrm_plugin_info, '3.8', '3.1'); if (!is_admin()) { cntctfrm_check_and_send(); } }
function gglstmp_init() { global $gglstmp_plugin_info; if (empty($gglstmp_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $gglstmp_plugin_info = get_plugin_data(__FILE__); } /* add general functions */ require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); /* check compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $gglstmp_plugin_info, '3.8', '3.1'); /* Get options from the database */ if (!is_admin() || isset($_GET['page']) && "google-sitemap-plugin.php" == $_GET['page']) { /* Get/Register and check settings for plugin */ gglstmp_register_settings(); } }
function mltlngg_init() { global $wpdb, $mltlngg_options, $mltlngg_table_translate, $mltlngg_terms_table_translate, $mltlngg_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (empty($mltlngg_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $mltlngg_plugin_info = get_plugin_data(__FILE__); } /* check WordPress version */ bws_wp_min_version_check(plugin_basename(__FILE__), $mltlngg_plugin_info, '3.8', '3.7'); $mltlngg_table_translate = $wpdb->prefix . 'mltlngg_translate'; $mltlngg_terms_table_translate = $wpdb->prefix . 'mltlngg_terms_translate'; mltlngg_register_settings(); /* If there have been changes in the list of languages do flush_rewrite_rules */ if (isset($_GET['action']) || isset($_POST['action']) || isset($_POST['action2']) || isset($_POST['mltlngg_add_new_language_form_was_send']) && true == $mltlngg_options['enabled_new_language']) { flush_rewrite_rules(); } }
function cptch_init() { global $cptch_plugin_info; require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); if (!$cptch_plugin_info) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $cptch_plugin_info = get_plugin_data(__FILE__); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check(plugin_basename(__FILE__), $cptch_plugin_info, '3.8', '3.1'); /* Call register settings function */ if (!is_admin() || isset($_GET['page']) && "captcha.php" == $_GET['page']) { cptch_settings(); } if (!is_admin()) { cptch_contact_form_options(); } }
function gllr_plugin_uninstall() { global $gllr_filenames, $gllr_themepath, $wpdb, $gllr_BWS_demo_data; foreach ($gllr_filenames as $filename) { if (file_exists($gllr_themepath . $filename) && !unlink($gllr_themepath . $filename)) { add_action('admin_notices', create_function('', ' return "Error delete template file";')); } } if (function_exists('is_multisite') && is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('gllr_options'); if (!$gllr_BWS_demo_data) { gllr_include_demo_data(); } $gllr_BWS_demo_data->bws_remove_demo_data(); } switch_to_blog($old_blog); } else { global $gllr_BWS_demo_data; delete_option('gllr_options'); if (!$gllr_BWS_demo_data) { gllr_include_demo_data(); } $gllr_BWS_demo_data->bws_remove_demo_data(); } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function cntctfrm_delete_options() { global $wpdb; $all_plugins = get_plugins(); if (!array_key_exists('contact-form-pro/contact_form_pro.php', $all_plugins)) { if (function_exists('is_multisite') && is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('cntctfrm_options'); $wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->prefix . "cntctfrm_field`;"); } switch_to_blog($old_blog); } else { delete_option('cntctfrm_options'); $wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->prefix . "cntctfrm_field`;"); } } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function gglcptch_delete_options() { global $wpdb; if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); if (!array_key_exists('google-captcha-pro/google-captcha-pro.php', $all_plugins)) { if (function_exists('is_multisite') && is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('gglcptch_options'); } switch_to_blog($old_blog); } else { delete_option('gglcptch_options'); } } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function prflxtrflds_uninstall() { global $wpdb; /* Drop all plugin tables */ $table_names = array('`' . $wpdb->base_prefix . 'prflxtrflds_fields_id`', '`' . $wpdb->base_prefix . 'prflxtrflds_field_types`', '`' . $wpdb->base_prefix . 'prflxtrflds_field_values`', '`' . $wpdb->base_prefix . 'prflxtrflds_roles_and_fields`', '`' . $wpdb->base_prefix . 'prflxtrflds_roles_id`', '`' . $wpdb->base_prefix . 'prflxtrflds_user_field_data`', '`' . $wpdb->base_prefix . 'prflxtrflds_user_roles`'); $wpdb->query("DROP TABLE IF EXISTS " . implode(', ', $table_names)); /* Delete options */ if (function_exists('is_multisite') && is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('prflxtrflds_options'); } switch_to_blog($old_blog); } else { delete_option('prflxtrflds_options'); } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function gglstmp_delete_settings() { global $wpdb; if (is_multisite()) { /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { delete_blog_option($blog_id, 'gglstmp_settings'); delete_blog_option($blog_id, 'gglstmp_robots'); $site_url = preg_replace("/[^a-zA-ZА-Яа-я0-9\\s]/", '_', str_replace('http://', '', str_replace('https://', '', get_site_url($blog_id)))); $file = ABSPATH . "sitemap_{$site_url}.xml"; if (file_exists($file)) { unlink($file); } } } else { delete_option('gglstmp_settings'); delete_option('gglstmp_robots'); $sitemap_path = ABSPATH . "sitemap.xml"; $sitemap_url = site_url('/sitemap.xml'); $robots_path = ABSPATH . "robots.txt"; if (file_exists($sitemap_path)) { unlink($sitemap_path); } if (file_exists($robots_path)) { if (!is_writable($robots_path)) { @chmod($robots_path, 0755); } if (is_writable($robots_path)) { $content = file_get_contents($robots_path); $content = preg_replace("|\nSitemap: {$sitemap_url}|", '', $content); file_put_contents($robots_path, $content); } } } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function mltlngg_delete_options() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { /* check if it is a network activation - if so, run the activation function for each blog id */ $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); _mltlngg_delete_options(); } switch_to_blog($old_blog); return; } _mltlngg_delete_options(); require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function adsns_plugin_init() { require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init('adsense-plugin/adsense-plugin.php'); if (empty($this->adsns_plugin_info)) { if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $this->adsns_plugin_info = get_plugin_data(dirname(__FILE__) . '/adsense-plugin.php'); } /* Function check if plugin is compatible with current WP version */ bws_wp_min_version_check('adsense-plugin/adsense-plugin.php', $this->adsns_plugin_info, '3.8', '3.3'); /* Call register settings function */ if (!is_admin() || isset($_GET['page']) && "adsense-plugin.php" == $_GET['page']) { $this->adsns_activate(); } }
function rrrlgvwr_uninstall() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('rrrlgvwr_options'); } switch_to_blog($old_blog); } else { delete_option('rrrlgvwr_options'); } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }
function cptch_delete_options() { global $wpdb; $all_plugins = get_plugins(); $another_captcha = array_key_exists('captcha-plus/captcha-plus.php', $all_plugins) || array_key_exists('captcha-pro/captcha-pro.php', $all_plugins) ? true : false; if (is_multisite()) { $old_blog = $wpdb->blogid; /* Get all blog ids */ $blogids = $wpdb->get_col("SELECT `blog_id` FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); delete_option('cptch_options'); if (!$another_captcha) { $prefix = 1 == $blog_id ? $wpdb->base_prefix : $wpdb->base_prefix . $blog_id . '_'; $wpdb->query("DROP TABLE `{$prefix}cptch_whitelist`;"); } } switch_to_blog($old_blog); } else { delete_option('cptch_options'); if (!$another_captcha) { $wpdb->query("DROP TABLE `{$wpdb->prefix}cptch_whitelist`;"); } } /* delete images */ if (!$another_captcha) { $wpdb->query("DROP TABLE `{$wpdb->base_prefix}cptch_images`, `{$wpdb->base_prefix}cptch_packages`;"); if (is_multisite()) { switch_to_blog(1); $upload_dir = wp_upload_dir(); restore_current_blog(); } else { $upload_dir = wp_upload_dir(); } $images_dir = $upload_dir['basedir'] . '/bws_captcha_images'; $packages = scandir($images_dir); if (is_array($packages)) { foreach ($packages as $package) { if (!in_array($package, array('.', '..'))) { /* remove all files from package */ array_map('unlink', glob($images_dir . "/" . $package . "/*.*")); /* remove package */ rmdir($images_dir . "/" . $package); } } } rmdir($images_dir); } require_once dirname(__FILE__) . '/bws_menu/bws_include.php'; bws_include_init(plugin_basename(__FILE__)); bws_delete_plugin(plugin_basename(__FILE__)); }