private function get_extensions()
 {
     // Save this for a latter date since our checkin for our HTML data doesn't get called on init...
     $ext_url = false;
     //add_query_arg( array( 'edd_action' => 'cl_announcements' ), trailingslashit( CUSTOM_LOGIN_API_URL ) . 'cl-checkin-api/' );
     $transient_key = CL_Common::get_transient_key('extensions');
     $extensions = CL_Common::wp_remote_get($ext_url, $transient_key, WEEK_IN_SECONDS, 'CustomLogin');
     if ($extensions) {
         $this->extensions[] = $extensions->html;
     } else {
         /* Stealth Login */
         $this->extensions[] = array('title' => 'Custom Login Stealth Login', 'description' => 'Protect your wp-login.php page from brute force attacks.', 'url' => 'https://frosty.media/plugins/custom-login-stealth-login/', 'image' => 'https://i.imgur.com/mhuymPG.jpg', 'links' => array(array('description' => 'Personal', 'download_id' => '108', 'price_id' => '1', 'price' => '$35'), array('description' => 'Plus', 'download_id' => '108', 'price_id' => '2', 'price' => '$95'), array('description' => 'Professional', 'download_id' => '108', 'price_id' => '3', 'price' => '$195')));
         /* Page Template */
         $this->extensions[] = array('title' => 'Custom Login Page Template', 'description' => 'Add a login form to any WordPress page.', 'url' => 'https://frosty.media/plugins/custom-login-page-template/', 'image' => 'https://i.imgur.com/A0rzS9q.jpg', 'links' => array(array('description' => 'Personal', 'download_id' => '120', 'price_id' => '1', 'price' => '$35'), array('description' => 'Plus', 'download_id' => '120', 'price_id' => '2', 'price' => '$95'), array('description' => 'Professional', 'download_id' => '120', 'price_id' => '3', 'price' => '$195')));
         /* Login Redirects */
         $this->extensions[] = array('title' => 'Custom Login Redirects', 'description' => 'Manage redirects after logging in.', 'url' => 'https://extendd.com/plugin/wordpress-login-redirects/', 'image' => 'https://i.imgur.com/aNGoyAa.jpg', 'links' => array(array('description' => 'Personal', 'download_id' => '124', 'price_id' => '1', 'price' => '$35'), array('description' => 'Plus', 'download_id' => '124', 'price_id' => '2', 'price' => '$95'), array('description' => 'Professional', 'download_id' => '124', 'price_id' => '3', 'price' => '$195')));
         /* No Password */
         $this->extensions[] = array('title' => 'Custom Login No Password', 'description' => 'Allow users to login without a password.', 'url' => 'https://frosty.media/plugins/custom-login-no-passowrd-login/', 'image' => 'https://i.imgur.com/7SXIpi5.jpg', 'links' => array(array('description' => 'Personal', 'download_id' => '128', 'price_id' => '1', 'price' => '$35'), array('description' => 'Plus', 'download_id' => '128', 'price_id' => '2', 'price' => '$95'), array('description' => 'Professional', 'download_id' => '128', 'price_id' => '3', 'price' => '$195')));
     }
     // if
 }
Ejemplo n.º 2
0
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since       3.0.0
 */
// Exit if accessed directly
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
// Load Custom Login
include_once 'custom-login.php';
include_once trailingslashit(CUSTOM_LOGIN_DIR) . 'includes/default-settings.php';
include_once trailingslashit(CUSTOM_LOGIN_DIR) . 'includes/class-cl-common.php';
// Delete all plugin options
foreach ($sections as $section) {
    delete_option($section['id']);
}
// Delete user meta data
$all_user_ids = get_users('fields=ID');
foreach ($all_user_ids as $user_id) {
    delete_user_meta($user_id, CUSTOM_LOGIN_OPTION . '_ignore_announcement');
}
// Delete all announcement options and transients
delete_transient(CL_Common::get_transient_key('announcement'));
delete_option(CUSTOM_LOGIN_OPTION . '_announcement_message');
// Delete tracking options
delete_option('custom_login_tracking_last_send');
delete_option('custom_login_hide_tracking_notice');
// Cleanup Cron Events
wp_clear_scheduled_hook('custom_login_daily_scheduled_events');
wp_clear_scheduled_hook('custom_login_weekly_scheduled_events');
// Delete version option
delete_option(CUSTOM_LOGIN_OPTION . '_version');
 /**
  * Show global notifications if they are allowed.
  *
  */
 function show_notifications()
 {
     $is_cl_screen = CL_Common::is_settings_page();
     $transient_key = CL_Common::get_transient_key('announcement');
     $ignore_key = CUSTOM_LOGIN_OPTION . '_ignore_announcement';
     $old_message = get_option(CUSTOM_LOGIN_OPTION . '_announcement_message');
     $user_meta = get_user_meta(get_current_user_id(), $ignore_key, true);
     $capability = CL_Common::get_option('capability', 'general', 'manage_options');
     /**
     		delete_user_meta( get_current_user_id(), $ignore_key, 1 );
     		delete_transient( $transient_key );
     		update_option( CUSTOM_LOGIN_OPTION . '_announcement_message', '' ); //*/
     // Current user can't manage options
     if (!current_user_can($capability)) {
         return;
     }
     if (!$is_cl_screen) {
         // Let's not show this at all if not on out menu page. @since 3.1
         return;
         // Global notifications
         if ('off' === CL_Common::get_option('admin_notices', 'general', 'off')) {
             return;
         }
         // Make sure 'Frosty_Media_Notifications' isn't activated
         if (class_exists('Frosty_Media_Notifications')) {
             return;
         }
     }
     // https://raw.github.com/thefrosty/custom-login/master/extensions.json
     $message_url = esc_url(add_query_arg(array('edd_action' => 'cl_announcements'), trailingslashit(CUSTOM_LOGIN_API_URL) . 'cl-checkin-api/'));
     $announcement = CL_Common::wp_remote_get($message_url, $transient_key, DAY_IN_SECONDS, 'CustomLogin');
     // Bail if errors
     if (is_wp_error($announcement)) {
         return;
     }
     // Bail if false or empty
     if (!$announcement || empty($announcement)) {
         return;
     }
     if (trim($old_message) !== trim($announcement->message) && !empty($old_message)) {
         delete_user_meta(get_current_user_id(), $ignore_key);
         delete_transient($transient_key);
         update_option(CUSTOM_LOGIN_OPTION . '_announcement_message', $announcement->message);
     }
     $html = '<div class="updated"><p>';
     $html .= !$is_cl_screen ? sprintf('%2$s <span class="alignright">| <a href="%3$s">%1$s</a></span>', __('Dismiss', CUSTOM_LOGIN_DIRNAME), $announcement->message, esc_url(add_query_arg($ignore_key, wp_create_nonce($ignore_key), admin_url('options-general.php?page=custom-login'))), esc_url(admin_url('options-general.php?page=custom-login#custom_login_general'))) : sprintf('%s', $announcement->message);
     $html .= '</p></div>';
     if (!$user_meta && 1 !== $user_meta || $is_cl_screen) {
         echo $html;
     }
 }
Ejemplo n.º 4
0
 /**
  * Database access to the scripts and styles.
  *
  * @since		2.1
  * @return		string|void
  */
 public function login_footer_jquery()
 {
     $jquery = CL_Common::get_option('custom_jquery', 'design', '');
     if ('' != $jquery) {
         global $cl_js_atts;
         $cl_js_atts = array('version' => CUSTOM_LOGIN_VERSION, 'trans_key' => CL_Common::get_transient_key('script'));
         $cl_js_atts = wp_parse_args(CL_Common::get_options('design'), $cl_js_atts);
         foreach ($cl_js_atts as $atts => $value) {
             if ('custom_jquery' !== $atts && 'version' !== $atts && 'trans_key' !== $atts) {
                 unset($cl_js_atts[$atts]);
             }
         }
         ob_start();
         echo "<script type=\"text/javascript\">\n";
         CL_Templates::get_template_part('wp-login', 'script');
         echo "\n</script>\n";
         echo ob_get_clean();
     }
 }