diff --git a/README.md b/README.md index 0fac0da..4768c5d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -#Memberlite: An Easy to Customize Theme for Membership Sites -=== -##Description ---------------- +# Memberlite: An Easy to Customize Theme for Membership Sites + +## Description **Build a Professional WordPress Membership Site** Memberlite is the ideal theme for your membership site - packed with integration for top membership site plugins including Paid Memberships Pro. It's fully customizable with your logo, colors, fonts, and more global layout settings. Extend the site appearance further with the Memberlite Elements and Memberlite Shortcodes plugins. Memberlite is responsive, clean and minimal. -##Copyright ---------------- +## Copyright Memberlite WordPress Theme, Copyright (C) 2018 Stranger Studios, LLC and other contributors Memberlite is distributed under the terms of the GNU GPL @@ -60,27 +58,26 @@ CSS grid based on Foundation by Zurb License: MIT License Source: https://foundation.zurb.com/get-involved/faq.html -##Getting Started ---------------- +## Getting Started Memberlite makes it easy to customize the appearance and layout of your site using the Theme Customization Screen (Appearance > Customize). -###Adding Your Logo +### Adding Your Logo Use the Customize > Site Identity screen to add a custom logo (formatted for retina display), update your Site Title and Tagline, and toggle the display of your Site Title & Tagline. -[Explore Documentation on Custom Headers in Memberlite](http://www.memberlitetheme.com/documentation/site-branding/) +[Explore Documentation on Custom Headers in Memberlite »](http://www.memberlitetheme.com/documentation/site-branding/) -###Customize the Theme +### Customize the Theme Use the Customize > Memberlite Options screen to modify theme layout, logo, fonts, colors, copyright message and more. [Explore Documentation on Customizing Memberlite »](http://memberlitetheme.com/documentation/customize/) -###Using Child Themes +### Using Child Themes If you need to customize the theme beyond theme settings, use a child theme. [Download a Blank Child Theme »](https://github.com/strangerstudios/memberlite-child) | [About Child Themes (WordPress Codex) »](http://codex.wordpress.org/Child_Themes) -###Integrated Plugins +### Integrated Plugins Memberlite includes formatting for use with: **Paid Memberships Pro** @@ -106,8 +103,7 @@ We highly recommend using these plugins for every site running Memberlite: **Theme My Login** [Install Theme My Login »](https://wordpress.org/plugins/theme-my-login/) - -###Changelog +### Changelog **4.2 - 2018-10-26** * SECURITY: Properly escaping the URL for excerpt_more. @@ -129,7 +125,7 @@ We highly recommend using these plugins for every site running Memberlite: * ENHANCEMENT: Added memberlite_the_excerpt and memberlite_more_content functions used in post template parts. **4.0.1 - 2018-09-25** -* SECURITY: Switching to use absint as a sanitizing function instead of intval_base10 which doesn't work. +* SECURITY: Switching to use absint as a sanitizing function instead of `intval_base10` which doesn't work. * SECURITY: Fixed escaping in the user account link. * BUG FIX: Fix targeting of jQuery for tabbable Content, Post Comments and Permalinks. * BUG FIX: Font Awesome icons added via the :before selector in css require a font-weight attribute. @@ -139,30 +135,30 @@ We highly recommend using these plugins for every site running Memberlite: * BUG FIX/ENHANCEMENT: Updating styles for BuddyPress to add to existing BuddyPress template stylesheets instead of complete override. * BUG FIX/ENHANCEMENT: Updating primary area form styling to reference the .site-content class instead of the #primary div. * BUG FIX/ENHANCEMENT: Updating the primary link color and hover color to use a class instead of an ID attribute. -* BUG FIX/ENHANCEMENT: Updating memberlite_page_nav function to bail if the post ID is 0. +* BUG FIX/ENHANCEMENT: Updating `memberlite_page_nav` function to bail if the post ID is 0. * BUG FIX/ENHANCEMENT: Font Awesome fixes for font-weight and buttons; Theme My Login 7 formatting fixes. -* BUG FIX/ENHANCEMENT: Updating check to require both Multiple Post Thumbnails and Memberlite Elements plugins to allow the show_both option in customizer. +* BUG FIX/ENHANCEMENT: Updating check to require both Multiple Post Thumbnails and Memberlite Elements plugins to allow the `show_both` option in customizer. * BUG FIX/ENHANCEMENT: Improving appearance of front page when set to static. * BUG FIX/ENHANCEMENT: Adjusting style for banner images in the loop. * BUG FIX/ENHANCEMENT: Updating Recent Posts w/Thumbnails widget to use grid instead of float. * BUG FIX/ENHANCEMENT: Fixing case where customizer preview wasn't adjusting site description when changing site title and tagline text color. * ENHANCEMENT: Moving all Theme My Login related styles to a separate optionally loaded integration file. * ENHANCEMENT: Fixing mobile navigation search form to be the same whether added via Widget or via the Memberlite Options > Search Form After Navigation setting. -* ENHANCEMENT: Adding pmpro_btn-cancel to the standard link color default customization. +* ENHANCEMENT: Adding `pmpro_btn-cancel` to the standard link color default customization. * ENHANCEMENT: Improving button and link-type button appearance throughout theme and for use in Paid Memberships Pro. * ENHANCEMENT: Fixing padding on bbPress search widget to match other widget spacing. * ENHANCEMENT: Removing padding on Custom HTML widget when placed in the sidebar (#secondary) location. * ENHANCEMENT: Cleaning up tabs on empty lines. * ENHANCEMENT: Removing the !important declaration from button font color. * ENHANCEMENT: Adjusting text size of post titles in recent posts with thumbnails widget. -* ENHANCEMENT: Adding rel="nofollow" to the custom excerpt more link. +* ENHANCEMENT: Adding `rel="nofollow"` to the custom excerpt more link. * ENHANCEMENT: Updating screenshot. * ENHANCEMENT: Updating "Tested up to" WordPress version value. * ENHANCEMENT: Adjusting featured image size in loop to use the 'medium' size for better appearance. -* FEATURE: Added 'memberlite_google_fonts_weights' filter to adjust which font weights are enqueued when loading Google Fonts. +* FEATURE: Added `memberlite_google_fonts_weights` filter to adjust which font weights are enqueued when loading Google Fonts. **4.0 - 2018-07-31** -* SECURITY/BUG FIX: Added esc_url to wp-admin links on theme welcome page. +* SECURITY/BUG FIX: Added `esc_url` to wp-admin links on theme welcome page. * SECURITY/BUG FIX: Various other escaping and sanitization fixes. (Thanks, Justin Tadlock and Sakin Shrestha) * BUG FIX: Hiding 'Register' link in meta menu if registration is disabled. * BUG FIX: Wrapping strings in customizer to fix redirect issue. @@ -174,7 +170,7 @@ We highly recommend using these plugins for every site running Memberlite: * ENHANCEMENT: Updating to version 5.2 of Font Awesome. * ENHANCEMENT: Adding WooCommerce page template 3.x support * ENHANCEMENT: Adding feature to define a member-menu area for logged out visitors -* ENHANCEMENT: Added {post_type} as a variable for the Post Entry Meta settings. +* ENHANCEMENT: Added `{post_type}` as a variable for the Post Entry Meta settings. * ENHANCEMENT: Added some web safe fonts (non-Google Font) options for the font settings. Also allowing translators to exclude certain fonts. **3.0.4 - 2017-10-27** @@ -183,38 +179,38 @@ We highly recommend using these plugins for every site running Memberlite: **3.0.3 - 2017-08-07** * BUG: Fixed float for Full Width and Narrow Width page templates when default pages layout set to left sidebar. -* NOTE/ENHACEMENT: Now only showing the post meta generated by memberlite_get_entry_meta() on the post CPT. +* NOTE/ENHACEMENT: Now only showing the post meta generated by `memberlite_get_entry_meta()` on the post CPT. * NOTE/ENHANCEMENT: Now only showing the footer widgets primary background stripe if there are active widgets in the area. * ENHANCEMENT: Added CSS for JetPack contact form submission/results blockquote. **3.0.2 - 2017-01-02** * BUG: Fixed issue with update code when PMPro is not installed. -* BUG/ENHANCEMENT: Now running "do_shortcode" on the "Banner Right" content. +* BUG/ENHANCEMENT: Now running `do_shortcode` on the "Banner Right" content. * BUG/ENHANCEMENT: CSS tweak for input elements in iOS browsers. * ENHANCEMENT: Added Narrow Width page template for an 8 column centered main content layout with no sidebar. **3.0.1 - 2016-12-06** -* BUG: Now hiding the wrapping

tag for memberlite_get_entry_meta before and after when set to none via customizer. +* BUG: Now hiding the wrapping `

` tag for `memberlite_get_entry_meta` before and after when set to none via customizer. * ENHANCEMENT: Added masthead with profile user name to bbPress single user profile view. -* BUG: Now filtering memberlite_banner_right to allow shortcodes. +* BUG: Now filtering `memberlite_banner_right` to allow shortcodes. * BUG: Fixing some display issues with no masthead and the blog sidebar float. * NOTE/ENHANCEMENT: Added the code back to update from the PMPro license server until we get approval in the WordPress repository. **3.0 - 2016-09-20** * ENHANCEMENT: Page banner description and banner right column now inheriting ratio of primary columns. * ENHANCEMENT: Adding support for toggling display of page masthead banner. -* BUG: Fixing index error on memberlite_cpt_sidebar_id. +* BUG: Fixing index error on `memberlite_cpt_sidebar_id`. * ENHANCEMENT: Added page setting for page icon and banner right icon display. * BUG: Fixing error when viewing archive and no $post is set. * BUG: Fixing error when missing pagemenuid in sidebar. * Cleaning blank spaces in style.css * BUG: Fixing CSS on checkout page headings (h2) for boxes added via Register Helper. -* BUG: Fixing some dark.css colors for Paid Memberships Pro and bbPress. +* BUG: Fixing some `dark.css` colors for Paid Memberships Pro and bbPress. * ENHANCEMENT: Added customization setting for columns ratio of primary and sidebar. -* BUG: Removed add_image_size('large') declaration +* BUG: Removed `add_image_size('large')` declaration * ENHANCEMENT: Added image size for 'fullwidth' (full width 12 columns - 1170px) * ENHANCEMENT: Added fallback to author avatar for recent posts widget when featured image is not set -* BUG: Fixing content_width for full width or fluid width page template. +* BUG: Fixing `content_width` for full width or fluid width page template. * ENHANCEMENT: Added single post meta settings with template variables for before and after post. * ENHANCEMENT: Added Back to Top footer link * ENHANCEMENT: Added customizer settings for page and post navigation @@ -239,16 +235,16 @@ We highly recommend using these plugins for every site running Memberlite: * BUG: Fixed comment/ping/trackback count for 'approve' status only. * BUG: Updated Comment Walker to respect PHP strict standards * BUG: Fixed homepage bottom banner when page template is defined. -* BUG: Fixed highlighted level in the compare_table layout when highlighted level is first column. -* BUG: Fixed current_user level class on compare_table layout in membership levels shortcode. -* BUG: Fixed notice when bbpress is not activated for memberlite_page_title function +* BUG: Fixed highlighted level in the `compare_table` layout when highlighted level is first column. +* BUG: Fixed `current_user` level class on `compare_table` layout in membership levels shortcode. +* BUG: Fixed notice when bbpress is not activated for `memberlite_page_title` function **2.0.3.4 - 2015-11-07** -* SECURITY: Now using get_search_query() and the_search_query() to prevent XSS issues in h1s and breadcrumbs on search results pages. (Thanks, retr0) +* SECURITY: Now using `get_search_query()` and `the_search_query()` to prevent XSS issues in h1s and breadcrumbs on search results pages. (Thanks, retr0) * ENHANCEMENT: Tweaks to checkout page CSS. **2.0.3.3** -* BUG: Updated memberlite_defaults for banner hover background color. +* BUG: Updated `memberlite_defaults` for banner hover background color. **2.0.3.2 - 2015-10-08** * BUG: Updated sidebar registration order so default widgets of new WP install are placed in the Posts custom sidebar. @@ -263,24 +259,24 @@ We highly recommend using these plugins for every site running Memberlite: * ENHANCEMENT: Added "lock" icon to membership-restricted post titles (requires PMPro v1.8.5.4 or higher) * ENHANCEMENT: Added the ability to select a separate banner and feature image when the Multiple Post Thumbnails Plugin () is enabled. * ENHANCEMENT: Setting the hover colors of primary, secondary, and action links to a lighter version of the color instead of using other colors from the color scheme. -* ENHANCEMENT: Moved memberlite_defaults array to a separate included file. +* ENHANCEMENT: Moved `memberlite_defaults` array to a separate included file. * ENHANCEMENT: Design improvements for galleries and image captions. **2.0.3.1 - 2015-08-26** * ENHANCEMENT: Support added for dark background via customizer setting and additional dark.css -* BUG: Fixing issue with [memberlite_subpagelist] shortcode thumbnail size setting +* BUG: Fixing issue with `[memberlite_subpagelist]` shortcode thumbnail size setting * BUG: Header text color fix in customizer **2.0.3 - 2015-08-26** * SECURITY: Fixed XSS issue with the h1 display of search queries. -* BUG: Removed pmpro_content_filter from banner description so it is not duplicated in post content. -* BUG: Fixing issue where archvies and index weren't showing full the_content when set in customizer. +* BUG: Removed `pmpro_content_filter` from banner description so it is not duplicated in post content. +* BUG: Fixing issue where archvies and index weren't showing full `the_content` when set in customizer. * ENHANCEMENT: Updating Title of Contents and general stylesheet formatting improvements. -* ENHANCEMENT: Added post_parent and thumbnail_size attributes to [memberlite_subpagelist] shortcode. -* ENHANCEMENT: Improved memberlite_getLevelCost function to respect price formatting filters in Paid Memberships Pro. +* ENHANCEMENT: Added `post_parent` and `thumbnail_size` attributes to `[memberlite_subpagelist]` shortcode. +* ENHANCEMENT: Improved `memberlite_getLevelCost` function to respect price formatting filters in Paid Memberships Pro. * ENHANCEMENT: Added masthead banner background image support to front-page template. * ENHANCEMENT: Added customizer settings for primary navigation bar background color and link color. -* ENHANCEMENT: Added 'scheme_SCHEMENAME' to body classes array when an included color scheme is selected in customizer.' +* ENHANCEMENT: Added `scheme_SCHEMENAME` to body classes array when an included color scheme is selected in customizer.' * ENHANCEMENT: Improved formatting for comments, nested comments, pingbacks and trackbacks **2.0.2** @@ -288,8 +284,8 @@ We highly recommend using these plugins for every site running Memberlite: * BUG: Updates to member menu area to only show the "member menu" selection if current user has membership level. **2.0.1** -* BUG: Added hook to reset update_themes cache when pmpro license is updated. -* ENHANCEMENT: Added the "pmpro_license_check_key_timeout" filter which can be used to set the timeout of the call to the PMPro License Server to something other than 5s. This is useful if you find your website timing out or having trouble getting updates. +* BUG: Added hook to reset `update_themes` cache when pmpro license is updated. +* ENHANCEMENT: Added the `pmpro_license_check_key_timeout` filter which can be used to set the timeout of the call to the PMPro License Server to something other than 5s. This is useful if you find your website timing out or having trouble getting updates. **2.0** * Initial version. diff --git a/components/page/content-page.php b/components/page/content-page.php index ef7abc5..e845327 100644 --- a/components/page/content-page.php +++ b/components/page/content-page.php @@ -21,7 +21,7 @@ diff --git a/inc/admin.php b/inc/admin.php index 5f71ecd..db75c81 100644 --- a/inc/admin.php +++ b/inc/admin.php @@ -13,19 +13,6 @@ function memberlite_theme_menu() { } add_action( 'admin_menu', 'memberlite_theme_menu' ); -/* - Redirect to Welcome tab if the user hasn't been there yet. -*/ -function memberlite_admin_init_redirect_to_welcome() { - $memberlite_welcome_version = get_option( 'memberlite_welcome_version', 0 ); - if (version_compare( $memberlite_welcome_version, MEMBERLITE_VERSION) < 0 ) { - update_option( 'memberlite_welcome_version', MEMBERLITE_VERSION, 'no' ); - wp_redirect( admin_url( 'admin.php?page=memberlite-support' ) ); - exit; - } -} -add_action( 'admin_init', 'memberlite_admin_init_redirect_to_welcome' ); - /* Render the welcome/support page */ @@ -340,8 +327,7 @@ function memberlite_support() { /* Load any notifications. - 1. Prompt the installation of memberlite-shortcodes if it's not activated already. - 2. Prompt the installation of pmpro-advanced-levels-shortcode if it's not activated already. + 1. Show link to the welcome page the first time the theme is activated */ // check for notifications function memberlite_admin_init_notifications() { @@ -351,43 +337,11 @@ function memberlite_admin_init_notifications() { $script = basename( $_SERVER['SCRIPT_NAME'] ); $maybe_installing = $script == 'update.php' || $script == 'plugins.php'; - // 1. Prompt the installation of memberlite-elements if it's not activated already. - if ( ! defined( 'MEMBERLITE_ELEMENTS_VERSION' ) && ! $maybe_installing ) { - // check if this notice has been dismissed already - $mle_dismissed = get_option( 'memberlite_notice_install_memberlite_elements_dismissed', false ); - if ( ! $mle_dismissed ) { - wp_enqueue_script( 'memberlite-admin-dismiss-notice', get_template_directory_uri() . '/js/admin-dismiss-notice.js', array( 'jquery' ), MEMBERLITE_VERSION, true ); - add_action( 'admin_notices', 'memberlite_admin_notice_install_memberlite_elements' ); - } - } - - // 2. Prompt the installation of memberlite-shortcodes if it's not activated already. - if ( ! defined( 'MEMBERLITESC_VERSION' ) && ! $maybe_installing ) { - // check if this notice has been dismissed already - $mls_dismissed = get_option( 'memberlite_notice_install_memberlite_shortcodes_dismissed', false ); - if ( ! $mls_dismissed ) { - wp_enqueue_script( 'memberlite-admin-dismiss-notice', get_template_directory_uri() . '/js/admin-dismiss-notice.js', array( 'jquery' ), MEMBERLITE_VERSION, true ); - add_action( 'admin_notices', 'memberlite_admin_notice_install_memberlite_shortcodes' ); - } - } - - // 3. Prompt the installation of pmpro-advanced-levels-shortcode if it's not activated already. - if ( ! function_exists( 'pmpro_advanced_levels_shortcode' ) && ! $maybe_installing ) { - // check if this notice has been dismissed already - $als_dismissed = get_option( 'memberlite_notice_install_advanced_levels_shortcode_dismissed', false ); - if ( ! $als_dismissed ) { - // check if they are using the [memberlite_levels] shortcode - $using_shortcode = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish' AND post_content LIKE '%[memberlite_levels%' LIMIT 1" ); - - if ( $using_shortcode ) { - // show notice - wp_enqueue_script( 'memberlite-admin-dismiss-notice', get_template_directory_uri() . '/js/admin-dismiss-notice.js', array( 'jquery' ), MEMBERLITE_VERSION, true ); - add_action( 'admin_notices', 'memberlite_admin_notice_install_advanced_levels_shortcode' ); - } else { - // not using the shortcode, so let's just dismiss the notice - update_option( 'memberlite_notice_install_advanced_levels_shortcode_dismissed', 1, 'no' ); - } - } + // 1. Show link to the welcome page the first time the theme is activated + $welcome_link_dismissed = get_option( 'memberlite_notice_welcome_link_dismissed', false ); + if ( ! $welcome_link_dismissed && ! $maybe_installing ) { + wp_enqueue_script( 'memberlite-admin-dismiss-notice', get_template_directory_uri() . '/js/admin-dismiss-notice.js', array( 'jquery' ), MEMBERLITE_VERSION, true ); + add_action( 'admin_notices', 'memberlite_admin_notice_welcome_link' ); } } add_action( 'admin_init', 'memberlite_admin_init_notifications' ); @@ -395,7 +349,7 @@ function memberlite_admin_init_notifications() { // AJAX to handle notice dismissal function memberlite_wp_ajax_dismiss_notice() { // whitelist of notices - $notices = array( 'install_advanced_levels_shortcode', 'install_memberlite_shortcodes' ); + $notices = array( 'welcome_link' ); // get and check notice $notice = $_REQUEST['notice']; @@ -411,83 +365,19 @@ function memberlite_wp_ajax_dismiss_notice() { add_action( 'wp_ajax_nopriv_memberlite_dismiss_notice', 'memberlite_wp_ajax_dismiss_notice' ); add_action( 'wp_ajax_memberlite_dismiss_notice', 'memberlite_wp_ajax_dismiss_notice' ); -// Install Memberlite Elements Notice -function memberlite_admin_notice_install_memberlite_elements() { - // check if the plugin is installed, but not active - if ( file_exists( WP_PLUGIN_DIR . '/memberlite-elements/memberlite-elements.php' ) ) { - // installed but not activated - $click_link = esc_url( wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=memberlite-elements/memberlite-elements.php' ), 'activate-plugin_memberlite-elements/memberlite-elements.php' ) ); - $click_text = __( - 'Click here to activate the Memberlite Elements plugin.', - 'memberlite' - ); - } else { - // need to install - $click_link = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=memberlite-elements' ), 'install-plugin_memberlite-elements' ) ); - $click_text = __( - 'Click here to install the Memberlite Elements plugin.', - 'memberlite' - ); - } - - // notice HTML - ?> -

-

: ' . $click_text . ''; ?>

-
- -
-

: ' . $click_text . ''; ?>

-
- -
-

: ' . $click_text . ''; ?>

+ ID ) . '" rel="nofollow">(more...)

'; + + if ( ! is_admin() ) { + $more = ' ' . esc_html( __( '(more...)', 'memberlite' ) ) . ''; + } + + return $more; } add_filter( 'excerpt_more', 'memberlite_excerpt_more' ); diff --git a/inc/updates.php b/inc/updates.php index 51b39dc..a6d4627 100644 --- a/inc/updates.php +++ b/inc/updates.php @@ -9,172 +9,9 @@ function memberlite_checkForUpdates() { $memberlite_db_version = get_option('memberlite_db_version', 0); - /** - * Upgrade from v2.0. - * - */ - if($memberlite_db_version < '2016091901') { - - /** - * We need to convert header images into site logos. - */ - $header_image_data = get_theme_mod('header_image_data'); - $custom_logo = get_theme_mod('custom_logo'); - - if(!empty($header_image_data) && empty($custom_logo)) { - $custom_logo = $header_image_data->attachment_id; - set_theme_mod('custom_logo', $custom_logo); - remove_theme_mod('header_image'); - remove_theme_mod('header_image_data'); - } - - /** - * We need to convert 'memberlite_show_image_banner' meta to '_memberlite_show_image_banner'. - */ - global $wpdb; - $sqlQuery = "UPDATE $wpdb->postmeta SET meta_key = '_memberlite_show_image_banner' WHERE meta_key = 'memberlite_show_image_banner'"; - $wpdb->query($sqlQuery); - - //update db version - $memberlite_db_version = '2016091901'; + // default DB version for Memberlite 4.0 + if( empty( $memberlite_db_version ) ) { + $memberlite_db_version = '2018080101'; update_option('memberlite_db_version', $memberlite_db_version, 'no'); } -} - -/* - NOTE: All code below here will be removed once the theme is in the WordPress.org repository -*/ - -/** - * Setup themes api filters - * - * @since 2.0 -*/ -function memberlite_setupUpdateInfo() -{ - if(!defined('PMPRO_LICENSE_SERVER')) - define('PMPRO_LICENSE_SERVER', 'http://license.paidmembershipspro.com'); - - add_filter('pre_set_site_transient_update_themes', 'memberlite_update_themes_filter'); - add_filter('http_request_args', 'memberlite_http_request_args_for_update_info', 10, 2); - add_action('update_option_pmpro_license_key', 'memberlite_update_option_pmpro_license_key', 10, 2); -} -add_action('init', 'memberlite_setupUpdateInfo'); -/** - * Get theme update information from the PMPro server. - * - * @since 2.0 - */ -function memberlite_getUpdateInfo() -{ - //check if forcing a pull from the server - $update_info = get_option("memberlite_update_info", false); - $update_info_timestamp = get_option("memberlite_update_info_timestamp", 0); - - //if no update_infos locally, we need to hit the server - if(empty($update_info) || !empty($_REQUEST['force-check']) || current_time('timestamp') > $update_info_timestamp+86400) - { - /** - * Filter to change the timeout for this wp_remote_get() request. - * - * @since 2.0.1 - * - * @param int $timeout The number of seconds before the request times out - */ - $timeout = apply_filters("memberlite_get_update_info_timeout", 5); - //get em - $remote_info = wp_remote_get(PMPRO_LICENSE_SERVER . "/themes/memberlite", $timeout); - - //test response - if(is_wp_error($remote_info) || empty($remote_info['response']) || $remote_info['response']['code'] != '200') - { - //error - if(function_exists('pmpro_setMessage')) - pmpro_setMessage("Could not connect to the PMPro License Server to get update information. Try again later.", "error"); - } - else - { - //update update_infos in cache - $update_info = json_decode(wp_remote_retrieve_body($remote_info), true); - delete_option('memberlite_update_info'); - add_option("memberlite_update_info", $update_info, NULL, 'no'); - } - - //save timestamp of last update - delete_option('memberlite_update_info_timestamp'); - add_option("memberlite_update_info_timestamp", current_time('timestamp'), NULL, 'no'); - } - - return $update_info; -} -/** -* Infuse theme update details when WordPress runs its update checker. -* -* @since 2.0 -* -* @param object $value The WordPress update object. -* @return object $value Amended WordPress update object on success, default if object is empty. -*/ -function memberlite_update_themes_filter( $value ) { - - // If no update object exists, return early. - if ( empty( $value ) ) { - return $value; - } - - // get update_info information - $update_info = memberlite_getUpdateInfo(); - - // no info? - if(empty($update_info)) - return $value; - - //get data for theme - $theme_file_abs = ABSPATH . 'wp-content/themes/' . $update_info['Slug']; - $theme_file = $theme_file_abs . "/style.css"; - $theme_data = wp_get_theme($update_info['Slug']); - //compare versions - if(!empty($update_info['License']) && version_compare($theme_data['Version'], $update_info['Version'], '<')) - { - $value->response[$update_info['Slug']] = array( - 'theme' => $update_info['Slug'], - 'new_version' => $update_info['Version'], - 'url' => $update_info['ThemeURI'], - 'package' => $update_info['Download'] - ); - } - - // Return the update object. - return $value; -} -/** - * Disables SSL verification to prevent download package failures. - * - * @since 2.0 - * - * @param array $args Array of request args. - * @param string $url The URL to be pinged. - * @return array $args Amended array of request args. - */ -function memberlite_http_request_args_for_update_info($args, $url) -{ - // If this is an SSL request and we are performing an upgrade routine, disable SSL verification. - if(strpos($url, 'https://') !== false && strpos($url, PMPRO_LICENSE_SERVER) !== false && strpos($url, "download") !== false) - $args['sslverify'] = false; - - return $args; -} -/** - * Force update of theme update data when the PMPro License key is updated - * - * @since 2.0 - * - * @param array $args Array of request args. - * @param string $url The URL to be pinged. - * @return array $args Amended array of request args. - */ -function memberlite_update_option_pmpro_license_key($old_value, $value) -{ - delete_option('memberlite_update_info_timestamp'); - delete_site_transient('update_themes'); } \ No newline at end of file diff --git a/style.css b/style.css index bd3d415..e14e2d5 100644 --- a/style.css +++ b/style.css @@ -1643,6 +1643,9 @@ a:active { .hentry { margin: 0 0 5.8rem; } +.page-template-blank .hentry { + margin: 0; +} .columns .hentry.memberlite_subpagelist_item {margin: 0; } .hentry .entry-banner { background-position: center center;