Example #1
0
 protected function _validate_form()
 {
     $url = wp_nonce_url('admin.php?page=vimeography-my-themes');
     if (false === ($creds = request_filesystem_credentials($url))) {
         // if we get here, then we don't have credentials yet,
         // but have just produced a form for the user to fill in,
         // so stop processing for now
         return true;
         // stop the normal page form from displaying
     }
     // now we have some credentials, try to get the wp_filesystem running
     if (!WP_Filesystem($creds)) {
         // our credentials were no good, ask the user for them again
         request_filesystem_credentials($url);
         return true;
     }
     if (empty($_FILES)) {
         return;
     }
     // if this fails, check_admin_referer() will automatically print a "failed" page and die.
     if (!empty($_FILES) && check_admin_referer('vimeography-install-theme', 'vimeography-theme-verification')) {
         $name = substr(wp_filter_nohtml_kses($_FILES['vimeography-theme']['name']), 0, -4);
         if ($_FILES['vimeography-theme']['type'] != 'application/zip') {
             $this->messages[] = array('type' => 'error', 'heading' => 'Ruh Roh.', 'message' => 'Make sure you are uploading the actual .zip file, not a subfolder or file.');
         } else {
             global $wp_filesystem;
             if (!unzip_file($_FILES['vimeography-theme']['tmp_name'], VIMEOGRAPHY_THEME_PATH)) {
                 $this->messages[] = array('type' => 'error', 'heading' => 'Ruh Roh.', 'message' => 'The theme could not be installed.');
             } else {
                 $this->messages[] = array('type' => 'success', 'heading' => 'Theme installed.', 'message' => 'You can now use the "' . $name . '" theme in your galleries.');
             }
         }
     }
 }
Example #2
0
 /**
  * @see CPAC_Column_Actions::get_actions()
  * @since 2.4.7
  */
 public function get_actions($id)
 {
     $actions = array();
     $user_object = new WP_User($id);
     $screen = get_current_screen();
     if ('site-users-network' == $screen->id) {
         $url = "site-users.php?id={$this->site_id}&";
     } else {
         $url = 'users.php?';
     }
     if (get_current_user_id() == $user_object->ID) {
         $edit_link = 'profile.php';
     } else {
         $edit_link = esc_url(add_query_arg('wp_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), "user-edit.php?user_id={$user_object->ID}"));
     }
     if (current_user_can('edit_user', $user_object->ID)) {
         $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a></strong><br />";
         $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     } else {
         $edit = "<strong>{$user_object->user_login}</strong><br />";
     }
     if (!is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID)) {
         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Delete') . "</a>";
     }
     if (is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID)) {
         $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url($url . "action=remove&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Remove') . "</a>";
     }
     return $actions;
 }
Example #3
0
 /**
  * Creates a nonce'd URL to redirect back to
  * @param  APP_Order $order Order being redirected back to
  * @return string           Return URL
  */
 protected function get_return_url($order)
 {
     if (!$order instanceof APP_Order && !$order instanceof APP_Order_Receipt) {
         trigger_error('Order must be an instance of APP_Order or APP_Order_Receipt', E_USER_WARNING);
     }
     return wp_nonce_url($order->get_return_url(), $this->identifier());
 }
        /**
         * Show update link.
         * Opens Thickbox with Changelog.
         */
        public function show_update_details()
        {
            $update_data = $this->get_update_data();
            // only show if an update is available
            if ($update_data === false) {
                return;
            }
            $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode($this->product->get_slug()), 'upgrade-theme_' . $this->product->get_slug());
            $update_onclick = ' onclick="if ( confirm(\'' . esc_js(__("Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.")) . '\') ) {return true;}return false;"';
            ?>
			<div id="update-nag">
				<?php 
            /* translators: %1$s expands to product name, %2$s expands to version, %3$s expands to changelog HTML link, %4$s expands to closing HTML link tag, %5$s expands to update HTML link */
            printf(__('<strong>%1$s version %2$s</strong> is available. %3$sCheck out what\'s new%4$s or %5$supdate now%4$s.'), $this->product->get_item_name(), $update_data->new_version, '<a href="#TB_inline?width=640&amp;inlineId=' . $this->product->get_slug() . '_changelog" class="thickbox" title="' . $this->get_item_name() . '">', '</a>', '<a href="' . $update_url . '" ' . $update_onclick . '>');
            ?>
			</div>
			<div id="<?php 
            echo $this->product->get_slug();
            ?>
_changelog" style="display: none;">
				<?php 
            echo wpautop($update_data->sections['changelog']);
            ?>
			</div>
			<?php 
        }
function pmpro_addon_pmpro_international_addresses_widget($addon)
{
    /* <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-international-addresses.jpg" /> */
    ?>
<div class="info">							
	<p>Adds long form addresses to the PMPro checkout.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-international-addresses/" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-international-addresses/pmpro-international-addresses.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-international-addresses/pmpro-international-addresses.php'), 'activate-plugin_pmpro-international-addresses/pmpro-international-addresses.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-international-addresses.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
Example #6
0
/**
 * Format the BuddyBar/Toolbar notifications
 *
 * @since 2.5.0 bbPress (r5155)
 *
 * @package bbPress
 *
 * @param string $action The kind of notification being rendered
 * @param int $item_id The primary item id
 * @param int $secondary_item_id The secondary item id
 * @param int $total_items The total number of messaging-related notifications waiting for the user
 * @param string $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
 */
function bbp_format_buddypress_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string')
{
    // Bail if not the notification action we are looking for
    if ('bbp_new_reply' !== $action) {
        return $action;
    }
    // New reply notifications
    $topic_id = bbp_get_reply_topic_id($item_id);
    $topic_title = bbp_get_topic_title($topic_id);
    $topic_link = wp_nonce_url(add_query_arg(array('action' => 'bbp_mark_read', 'topic_id' => $topic_id), bbp_get_reply_url($item_id)), 'bbp_mark_topic_' . $topic_id);
    $title_attr = __('Topic Replies', 'bbpress');
    if ((int) $total_items > 1) {
        $text = sprintf(__('You have %d new replies', 'bbpress'), (int) $total_items);
        $filter = 'bbp_multiple_new_subscription_notification';
    } else {
        if (!empty($secondary_item_id)) {
            $text = sprintf(__('You have %d new reply to %2$s from %3$s', 'bbpress'), (int) $total_items, $topic_title, bp_core_get_user_displayname($secondary_item_id));
        } else {
            $text = sprintf(__('You have %d new reply to %s', 'bbpress'), (int) $total_items, $topic_title);
        }
        $filter = 'bbp_single_new_subscription_notification';
    }
    // WordPress Toolbar
    if ('string' === $format) {
        $return = apply_filters($filter, '<a href="' . esc_url($topic_link) . '" title="' . esc_attr($title_attr) . '">' . esc_html($text) . '</a>', (int) $total_items, $text, $topic_link);
        // Deprecated BuddyBar
    } else {
        $return = apply_filters($filter, array('text' => $text, 'link' => $topic_link), $topic_link, (int) $total_items, $text, $topic_title);
    }
    do_action('bbp_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items);
    return $return;
}
Example #7
0
	function upgrade_anchor($title = '')
	{
		//Assemble our url, nonce and all
		$url = wp_nonce_url($this->admin_url() . '&' . $this->unique_prefix . '_admin_upgrade=true', $this->unique_prefix . '_admin_upgrade');
		//Return a valid Undo anchor
		return ' <a title="' . $title . '" href="' . $url . '">' . __('Migrate now.', $this->identifier) . '</a>';
	}
 private function getLicensingPageUrl()
 {
     $url = add_query_arg('action', $this->getAjaxActionName(), admin_url('admin-ajax.php'));
     $url = wp_nonce_url($url, 'show_license');
     //Assumes the default license action = "show_license".
     return $url;
 }
function pmpro_addon_pmpro_affiliates_widget($addon)
{
    ?>
<div class="info">							
	<p>Lightweight Affiliate system. Create affiliate accounts and codes; tracks checkouts by affiliate account.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-affiliates/blob/master/readme.txt" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-affiliates/archive/master.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
Example #10
0
    function column_title($item)
    {
        $actions = array();
        $view_link = add_query_arg(array('page' => 'cf7_storage', 'action' => 'view', 'post_id' => absint($item->ID)), wp_nonce_url('admin.php', 'bulk-posts'));
        $actions['quick-preview'] = sprintf('<a href="#entry-preview-%d">%s</a>', $item->ID, __('Preview', 'cf7-storage'));
        if ($this->is_trash) {
            $actions['untrash'] = sprintf('<a href="%s">%s</a>', add_query_arg('action', 'untrash', $view_link), __('Restore', 'cf7-storage'));
            $actions['export'] = sprintf('<a href="%s">%s</a>', add_query_arg('action', 'export', $view_link), __('Export as CSV', 'cf7-storage'));
            $actions['delete'] = sprintf('<a href="%s">%s</a>', add_query_arg('action', 'delete', $view_link), __('Delete Permanently', 'cf7-storage'));
        } else {
            $actions['view'] = sprintf('<a href="%s">%s</a>', $view_link, __('View', 'cf7-storage'));
            $actions['export'] = sprintf('<a href="%s">%s</a>', add_query_arg('action', 'export', $view_link), __('Export as CSV', 'cf7-storage'));
            $actions['trash'] = sprintf('<a href="%s">%s</a>', add_query_arg('action', 'trash', $view_link), __('Trash', 'cf7-storage'));
        }
        $cf7_edit_url = add_query_arg(array('page' => 'wpcf7', 'action' => 'view', 'post' => absint($item->post_parent)), admin_url('admin.php'));
        return sprintf('<a class="row-entry-title" href="%s" title="%s">
					<h3 class="entry-from">%s</h3>
					<h4 class="entry-subject">%s</h4>
				</a>
				%s
				<div id="entry-preview-%d" class="row-entry-preview">
					<div class="entry-preview-wrap">
						%s
					</div>
				</div>', $view_link, esc_attr(sprintf(__('View this submission from %s', 'cf7-storage'), $item->post_title)), esc_html($item->post_title), esc_html(get_post_meta($item->ID, 'mail_subject', true)), $this->row_actions($actions), esc_attr($item->ID), apply_filters('the_content', get_post_meta($item->ID, 'mail_body', true)));
    }
Example #11
0
 function widget()
 {
     if (!is_user_logged_in()) {
         return;
     }
     $post = get_post();
     switch ($this->post_type) {
         case 'page':
             if ($post->post_type !== 'page') {
                 return;
             }
             break;
         default:
             if ($post->post_type !== $this->post_type && !is_post_type_archive($this->post_type)) {
                 return;
             }
             break;
     }
     $watchlist = get_post_meta($post->ID, '_wporg_watchlist', true);
     if ($watchlist && in_array(get_current_user_id(), $watchlist)) {
         printf('<p>You are watching this page. <a href="%s">Unwatch</a></p>', wp_nonce_url(admin_url('admin-post.php?action=wporg_watchlist&post_id=' . $post->ID), 'unwatch-' . $post->ID));
     } else {
         printf('<p><a href="%s">Watch this page</a></p>', wp_nonce_url(admin_url('admin-post.php?action=wporg_watchlist&watch=1&post_id=' . $post->ID), 'watch-' . $post->ID));
     }
 }
function pmpro_addon_pmpro_register_helper_widget($addon)
{
    ?>
<img class="addon-thumb" src="<?php 
    echo PMPRO_URL;
    ?>
/adminpages/addons/images/pmpro-register-helper.gif" />
<div class="info">							
	<p>Add additional meta fields to your PMPro checkout page and/or "Your Profile" pages. Support for text, select, multi-select, textarea, hidden, and custom HTML. Loop into existing checkout/profile field sections or add new ones.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-register-helper/blob/master/readme.txt" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-register-helper/pmpro-register-helper.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-register-helper/pmpro-register-helper.php'), 'activate-plugin_pmpro-register-helper/pmpro-register-helper.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-register-helper.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
 /**
  * Adds a purge buttion in the admin bar menu
  *
  * @param $wp_admin_bar WP_Admin_Bar
  * @since 2.2.1
  */
 function add_admin_bar_purge($wp_admin_bar)
 {
     $args = array('id' => 'SG_CachePress_Supercacher_Purge', 'title' => 'Purge SG Cache', 'href' => wp_nonce_url(admin_url('admin-post.php?action=sg-cachepress-purge'), 'sg-cachepress-purge'), 'meta' => array('class' => 'sg-cachepress-admin-bar-purge'));
     if (current_user_can('manage_options')) {
         $wp_admin_bar->add_node($args);
     }
 }
Example #14
0
 /**
  * Display Purge from cache on Page/Post post.php.
  */
 function post_submitbox_start()
 {
     if (current_user_can('manage_options')) {
         global $post;
         echo '<div>', sprintf('<a href="%s">' . __('Purge from cache', 'w3-total-cache') . '</a>', wp_nonce_url(sprintf('admin.php?page=w3tc_dashboard&w3tc_flush_pgcache_purge_page&post_id=%d', $post->ID), 'w3tc')), '</div>';
     }
 }
Example #15
0
 /**
  * Activate plugin action
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_generic') {
         /**
          * Disable enhanced mode if permalink structure is disabled
          */
         $permalink_structure = get_option('permalink_structure');
         if ($permalink_structure == '') {
             $this->_config->set('pgcache.engine', 'file');
             $this->_config->save();
         } else {
             if (w3_can_modify_rules(w3_get_pgcache_rules_core_path())) {
                 $this->write_rules_core();
             }
             if (w3_can_modify_rules(w3_get_pgcache_rules_cache_path())) {
                 $this->write_rules_cache();
             }
         }
     }
     if (!$this->locked()) {
         if (!@copy(W3TC_INSTALL_FILE_ADVANCED_CACHE, W3TC_ADDIN_FILE_ADVANCED_CACHE)) {
             w3_writable_error(W3TC_ADDIN_FILE_ADVANCED_CACHE);
         }
         if ((!defined('WP_CACHE') || !WP_CACHE) && !$this->enable_wp_cache()) {
             $reactivate_url = wp_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
             $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
             $error = sprintf('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'WP_CACHE\', true);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong><br />then %s.', ABSPATH, $reactivate_button);
             w3_activate_error($error);
         }
     }
     $this->schedule();
     $this->schedule_prime();
 }
function powerpressplayer_videojs_info()
{
    $plugin_link = '';
    if (!function_exists('add_videojs_header') && file_exists(WP_PLUGIN_DIR . '/' . 'videojs-html5-video-player-for-wordpress')) {
        $plugin_file = 'videojs-html5-video-player-for-wordpress' . '/' . 'video-js.php';
        $plugin_link = '<a href="' . esc_url(wp_nonce_url(admin_url('plugins.php?plugin_status=active&action=activate&plugin=' . $plugin_file), 'activate-plugin_' . $plugin_file)) . '"title="' . esc_attr__('Activate Plugin') . '"">' . __('VideoJS - HTML5 Video Player for WordPress plugin', 'powerpress') . '</a>';
    } else {
        $plugin_link = '<a href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . 'videojs-html5-video-player-for-wordpress' . '&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' . esc_attr__('Install Plugin') . '">' . __('VideoJS - HTML5 Video Player for WordPress plugin', 'powerpress') . '</a>';
    }
    ?>
	<p>
		<?php 
    echo __('VideoJS is a HTML5 JavaScript and CSS video player with fallback to Flash. ', 'powerpress');
    ?>
	</p>
	
	<?php 
    if ($plugin_link) {
        ?>
	<p <?php 
        echo function_exists('add_videojs_header') ? '' : ' style="background-color: #FFFFE0; border: 1px solid #E6DB55; padding: 8px 12px; line-height: 29px; font-weight: bold; font-size: 14px; display:inline;"';
        ?>
>
		<?php 
        echo sprintf(__('The %s must be installed and activated in order to enable this feature.', 'powerpress'), $plugin_link);
        ?>
	</p>
	<?php 
    }
}
Example #17
0
function pmpro_addon_pmpro_series_widget($addon)
{
    ?>
<img class="addon-thumb" src="<?php 
    echo PMPRO_URL;
    ?>
/adminpages/addons/images/pmpro-series.gif" />
<div class="info">						
	<p>"Drip feed" content to your members over the course of their membership. Serializes content by # of days post-registration.</p>
	<div class="actions">									
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="<?php 
        echo admin_url("edit.php?post_type=pmpro_series");
        ?>
" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-series/pmpro-series.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-series/pmpro-series.php'), 'activate-plugin_pmpro-series/pmpro-series.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-series.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
function pmpro_addon_pmpro_wp_affiliate_widget($addon)
{
    ?>
<img class="addon-thumb" src="<?php 
    echo PMPRO_URL;
    ?>
/adminpages/addons/images/pmpro-wp-affiliate-platform.jpg" />
<div class="info">							
	<p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-wp-affiliate-platform/" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php'), 'activate-plugin_pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-wp-affiliate-platform.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
				
	</div>							
</div> <!-- end info -->
<?php 
}
function pmpro_addon_pmpro_shipping_widget($addon)
{
    /* <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-shipping.jpg" /> */
    ?>
<div class="info">							
	<p>Adds shipping fields to the checkout page, confirmation page, confirmation emails, member's list and edit user profile pages.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-shipping/" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-shipping/pmpro-shipping.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-shipping/pmpro-shipping.php'), 'activate-plugin_pmpro-shipping/pmpro-shipping.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-shipping.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
 public function column_ccode($item)
 {
     $actions = array();
     $actions['edit'] = sprintf('<a href="?page=%s&action=%s&coupon_id=%s">%s</a>', esc_attr($_REQUEST['page']), 'edit', esc_attr($item->id), __('Edit', 'membership2'));
     $actions['delete'] = sprintf('<span class="delete"><a href="%s">%s</a></span>', wp_nonce_url(sprintf('?page=%s&coupon_id=%s&action=%s', esc_attr($_REQUEST['page']), esc_attr($item->id), 'delete'), 'delete'), __('Delete', 'membership2'));
     return sprintf('<code>%1$s</code> %2$s', $item->name, $this->row_actions($actions));
 }
        /**
         * Show update link.
         * Opens Thickbox with Changelog.
         */
        public function show_update_details()
        {
            $update_data = $this->get_update_data();
            // only show if an update is available
            if ($update_data === false) {
                return;
            }
            $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode($this->product->get_slug()), 'upgrade-theme_' . $this->product->get_slug());
            $update_onclick = ' onclick="if ( confirm(\'' . esc_js(__("Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.")) . '\') ) {return true;}return false;"';
            ?>
			<div id="update-nag">
				<?php 
            printf(__('<strong>%s version %s</strong> is available. <a href="%s" class="thickbox" title="%s">Check out what\'s new</a> or <a href="%s" %s>update now</a>.'), $this->product->get_item_name(), $update_data->new_version, '#TB_inline?width=640&amp;inlineId=' . $this->product->get_slug() . '_changelog', $this->get_item_name(), $update_url, $update_onclick);
            ?>
			</div>
			<div id="<?php 
            echo $this->product->get_slug();
            ?>
_changelog" style="display: none;">
				<?php 
            echo wpautop($update_data->sections['changelog']);
            ?>
			</div>
			<?php 
        }
        /**
         * Show the dupe product link in admin
         */
        public function dupe_button()
        {
            global $post;
            if (!current_user_can(apply_filters('woocommerce_duplicate_product_capability', 'manage_woocommerce'))) {
                return;
            }
            if (!is_object($post)) {
                return;
            }
            if ($post->post_type != 'product') {
                return;
            }
            if (isset($_GET['post'])) {
                $notifyUrl = wp_nonce_url(admin_url("edit.php?post_type=product&action=duplicate_product&post=" . absint($_GET['post'])), 'woocommerce-duplicate-product_' . $_GET['post']);
                ?>
			<div id="duplicate-action"><a class="submitduplicate duplication" href="<?php 
                echo esc_url($notifyUrl);
                ?>
"><?php 
                _e('Copy to a new draft', 'woocommerce');
                ?>
</a></div>
			<?php 
            }
        }
/**
 * Admin Messages
 *
 * @access      private
 * @since       1.0 
 * @return      void
*/
function edd_admin_messages()
{
    global $typenow;
    if ('download' != $typenow) {
        return;
    }
    $edd_access_level = edd_get_menu_access_level();
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'discount_updated' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-discount-updated', __('Discount code updated.', 'edd'), 'updated');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'discount_update_failed' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-discount-updated-fail', __('There was a problem updating your discount code, please try again.', 'edd'), 'error');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'payment_deleted' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-payment-deleted', __('The payment has been deleted.', 'edd'), 'updated');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'email_sent' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-payment-sent', __('The purchase receipt has been resent.', 'edd'), 'updated');
    }
    if (!get_option('edd_payment_totals_upgraded')) {
        // the payment history needs updated for version 1.1.9
        $url = add_query_arg('edd-action', 'upgrade_payments');
        $upgrade_notice = sprintf(__('The payment history needs updated. %s'), '<a href="' . wp_nonce_url($url, 'edd_upgrade_payments_nonce') . '">' . __('Click to Upgrade', 'edd') . '</a>');
        add_settings_error('edd-notices', 'edd-payments-upgrade', $upgrade_notice, 'error');
    }
    settings_errors('edd-notices');
}
 function update_nag()
 {
     $theme = wp_get_theme($this->theme_slug);
     $api_response = get_transient($this->response_key);
     if (false === $api_response) {
         return;
     }
     $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode($this->theme_slug), 'upgrade-theme_' . $this->theme_slug);
     // CT Mod: change message, add textdomain
     //$update_onclick = ' onclick="if ( confirm(\'' . esc_js( __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update." ) ) . '\') ) {return true;}return false;"';
     $update_onclick = ' onclick="if ( confirm(\'' . esc_js(sprintf(__("Any customizations you have made directly to %s's theme files will be lost. Please consider using a child theme for modifications.", "church-theme-framework"), $theme->get('Name'))) . '\') ) {return true;}return false;"';
     if (version_compare($this->version, $api_response->new_version, '<')) {
         echo '<div id="update-nag">';
         // CT Mod: Change message, localize -- now link directly to changelog
         /*
         printf( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
         	$theme->get( 'Name' ),
         	$api_response->new_version,
         	'#TB_inline?width=640&amp;inlineId=' . $this->theme_slug . '_changelog',
         	$theme->get( 'Name' ),
         	$update_url,
         	$update_onclick
         );
         */
         printf(__('<strong>%1$s %2$s</strong> is available. <a href="%3$s"%4$s>Update Now</a> or read the <a href="%5$s" target="_blank">Changelog</a>.', 'church-theme-framework'), $theme->get('Name'), $api_response->new_version, $update_url, $update_onclick, 'http://churchthemes.com/go/changelog/' . CTFW_THEME_SLUG . '/');
         echo '</div>';
         echo '<div id="' . $this->theme_slug . '_' . 'changelog" style="display:none;">';
         echo wpautop($api_response->sections['changelog']);
         echo '</div>';
     }
 }
 function after()
 {
     if (empty($this->upgrader->result['destination_name'])) {
         return;
     }
     $theme_info = $this->upgrader->theme_info();
     if (empty($theme_info)) {
         return;
     }
     $name = $theme_info['Name'];
     $stylesheet = $this->upgrader->result['destination_name'];
     $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
     $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
     $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
     $install_actions = array('preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>', 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $name)) . '">' . __('Activate') . '</a>');
     if (is_network_admin() && current_user_can('manage_network_themes')) {
         $install_actions['network_enable'] = '<a href="' . esc_url(wp_nonce_url('themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template)) . '" title="' . esc_attr__('Enable this theme for all sites in this network') . '" target="_parent">' . __('Network Enable') . '</a>';
     }
     $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('View Installed Themes', 'wp-app-store') . '</a>';
     if (!$this->result || is_wp_error($this->result) || is_network_admin()) {
         unset($install_actions['activate'], $install_actions['preview']);
     }
     $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
     if (!empty($install_actions)) {
         $this->feedback(implode(' | ', (array) $install_actions));
     }
 }
function ds_delete_stale()
{
    global $wpdb;
    $query = "SELECT * FROM {$wpdb->signups} ORDER BY registered DESC";
    $results = $wpdb->get_results($query, ARRAY_A);
    if (isset($_GET['delete'])) {
        $delete = $_GET['delete'];
    }
    if (isset($_GET['del_stale_active'])) {
        $del_stale_active = $_GET['del_stale_active'];
    }
    if (isset($_GET['del_stale_inactive'])) {
        $del_stale_inactive = $_GET['del_stale_inactive'];
    }
    $location = network_admin_url('users.php?page=act_keys');
    if (!empty($delete)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE activation_key = '{$delete}'");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_active)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 1 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_inactive)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 0 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    echo '<div class="wrap">';
    echo "<h2>User Activation Keys</h2>";
    if ($results) {
        echo '<p>The following is a list of user activation keys from $wpdb->signups. Delete a key to allow the username to (re)signup and bypass the "couple days" it takes WP to free up its hold on a user name. You can also manually approve users that for whatever reason have not completed their activation.</p>';
        echo '<div class="tablenav"> <span class="alignleft">';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_active', 'activation_key') . '" class="delete">' . __('Delete stale active signup keys older than 30 days') . '</a>';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_inactive', 'activation_key') . '" class="delete">' . __('Delete stale inactive signup keys older than 30 days') . '</a>';
        echo '</span>';
        echo '</div><br class="clear" />';
        echo '<table class="widefat"><tbody>';
        echo '<thead><th>#</th><th>Registered</th><th>User</th><th>Email</th><th>Approve</th></thead>';
        foreach ($results as $rows) {
            global $ct;
            echo '<tr><td>' . ++$ct . '</td><td>' . $rows['registered'] . '</td><td>' . $rows['user_login'] . '</td><td>' . $rows['user_email'] . '</td>';
            if ($rows['active'] != '1') {
                echo '<td><a href="' . site_url('wp-activate.php?key=' . $rows['activation_key']) . '" target="_blank">approve</a> | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete unused key</a></td>';
            } else {
                echo '<td>User Activated ' . $rows['activated'] . ' | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete uncecessary key</a></td>';
            }
            echo '</tr>';
        }
        echo '</tbody></table>';
    } else {
        echo '<p>No user activation keys in $wpdb->signups. If you delete a user, you should be able to reuse the username immediatley. If the user still had a registration key, it would need to be deleted before you could signup again right away with the same username. You can also manually approve users that for whatever reason have not completed their activation.</p>';
    }
    echo '</div>';
}
function pmpro_addon_pmpro_network_subsite_widget($addon)
{
    ?>
<img class="addon-thumb" src="<?php 
    echo PMPRO_URL;
    ?>
/adminpages/addons/images/pmpro-network.gif" />
<div class="info">							
	<p>Have network subsites use membership data from a "main" site to handle access restrictions.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-network-subsite" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-network-subsite/pmpro-network-subsite.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network-subsite/pmpro-network-subsite.php'), 'activate-plugin_pmpro-network-subsite/pmpro-network-subsite.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network-subsite.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
function pmpro_addon_pmpro_addon_packages_widget($addon)
{
    ?>
<div class="info">							
	<p>Sell access to individual pages or posts for a flat fee. This is a workaround if you would like to allow multiple membership levels per user.</p>
	<div class="actions">							
		<?php 
    if ($addon['enabled']) {
        ?>
			<a href="https://github.com/strangerstudios/pmpro-addon-packages/blob/master/readme.txt" class="button">Enabled</a>
		<?php 
    } elseif (file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) {
        ?>
			<a href="<?php 
        echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php');
        ?>
" class="button button-primary">Activate</a>
		<?php 
    } else {
        ?>
			<a href="https://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-addon-packages.zip" class="button button-primary">Download</a>
		<?php 
    }
    ?>
	</div>						
</div> <!-- end info -->
<?php 
}
Example #29
0
/**
 * Returns popup button html
 *
 * @param string $text
 * @param string $action
 * @param string $params
 * @param integer $width
 * @param integer $height
 * @return string
 */
function w3_button_popup($text, $action, $params = '', $width = 800, $height = 600)
{
    $url = wp_nonce_url(sprintf('admin.php?page=w3tc_dashboard&w3tc_%s%s', $action, $params != '' ? '&' . $params : ''), 'w3tc');
    $url = str_replace('&amp;', '&', $url);
    $onclick = sprintf('window.open(\'%s\', \'%s\', \'width=%d,height=%d,status=no,toolbar=no,menubar=no,scrollbars=yes\');', $url, $action, $width, $height);
    return w3_button($text, $onclick);
}
 /**
  * Cherry_Options_Framework_Admin constructor
  *
  * @since 4.0.0
  */
 function __construct()
 {
     // attach import/export options handlers
     add_action('wp_ajax_cherry_export_options', array($this, 'export_options'));
     add_action('wp_ajax_cherry_import_options', array($this, 'import_options'));
     add_action('wp_ajax_cherry_save_options', array($this, 'cherry_save_options'));
     add_action('wp_ajax_cherry_restore_section', array($this, 'cherry_restore_section'));
     add_action('wp_ajax_cherry_restore_options', array($this, 'cherry_restore_options'));
     add_action('wp_ajax_get_options_section', array($this, 'get_options_section'));
     add_action('wp_ajax_default_options_backup', array($this, 'default_options_backup'));
     // add options to allowed MIME types
     add_filter('upload_mimes', array($this, 'add_options_mime'));
     $this->init();
     $url = add_query_arg(array('action' => 'cherry_export_options'), admin_url('admin-ajax.php'));
     self::$options_export_url = wp_nonce_url($url, 'cherry_export');
     // add shortcode button for wp editor
     if (class_exists('Cherry_Shortcodes')) {
         //Cherry_Shortcodes_Generator::popup();
         // Request assets.
         //wp_enqueue_media();
         /*$admin_styles = apply_filters(
         			'cherry_shortcodes_admin_styles',
         			array( 'simple-slider', 'farbtastic', 'magnific-popup', 'font-awesome', 'cherry-shortcodes-all', 'cherry-shortcodes-generator' )
         		);
         		cherry_query_asset( 'css', $admin_styles );
         		cherry_query_asset( 'js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'simple-slider', 'farbtastic', 'magnific-popup', 'cherry-shortcodes-generator' ) );*/
     }
 }