diff --git a/README.md b/README.md index 5798cf946..d3aee4803 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go Donate link: https://www.paypal.me/Kaludi/25 Requires at least: 3.0 Tested up to: 5.3.2 -Stable tag: 1.0.22 +Stable tag: 1.0.24 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -194,6 +194,30 @@ Device testing done through [BrowserStack](https://www.browserstack.com) == Changelog == += 1.0.24 (11th February 2020) = +* Improvement: Added filter to modify the breadcrumb homepage url #4077 +* Fixed: Image alignment on the left issue #4156 +* Fixed: H1 tag not appearing on posts #4121 +* Fixed: "Title on static page front page" option not working #4138 +* Fixed: AMP Menu option was not showing in WP settings #4129 +* Fixed: Blank Events Calendar Months Page when 'Minify' option is enabled #4080 +* Fixed: Removed '@' in Twitter Handle #4135 +* Fixed: Message improved when "Leverage Browser Caching" option is enable without readable or writable permission of htaccess file #4127 +* Fixed: Featured image removed on AMP Pagebuilder pages #4131 + += 1.0.23 (7th February 2020) = +* Fixed: Fatal error in amp theme framework if WordPress directory is modified #4145 +* Fixed: Iframe error due to Jetpack #4125 +* Fixed: Menu transient increased to avoid deadlock error #4133 +* Fixed: Moved "Breadcrumbs From Yoast" to SEO option Panel section. #3600 +* Fixed: Featured Image from the content is not fetching the image when height and width is not present in the image code in Classic editor. #4096 +* Improvement: Sorting option for Pagebuilder slider/gallery #2014 +* Improvement: Option for showing no. of words in the excerpt of Recent Posts and Related Posts #3640 +* Improvement: Link Comments section with comments order #3740 +* Improvement: Default fallback images Added #3719 +* Improvement: subscript and superscript support #4137 +* Improvement: Message added if no seo option is selected but seo plugin is active #4124 + = 1.0.22 (6th February 2020) = * Fixed: Console error - Uncaught TypeError: Cannot read property 'on' of null #4102 * Fixed: When Insert post ads plugin is enable then AMP settings panel is not showing. #4107 @@ -204,14 +228,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com) * Fixed: Upgrade to Pro option was removing in the setting panel when we activate PWA for WP plugin #4117 * Fixed: FAQ section improved #4119 -= 1.0.21 (4th February 2020) = -* Fixed: Fatal error when AMP theme framework is active #4128 - -= 1.0.20 (31st January 2020) = -* Improvement: Filter added to Modify the location of the theme files from plugin older. #4091 -* Improvement: Cache Should auto clear when any plugin is activated/deactivated #4046 -* Improvement: Need to add nofollow feature in cookie notification option #3612 -* Fixed: Pages won't save apostophies in AMP page builder text module. #4074 -* Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946 - Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt) \ No newline at end of file diff --git a/accelerated-moblie-pages.php b/accelerated-moblie-pages.php index 2f1702888..fcaeb103c 100644 --- a/accelerated-moblie-pages.php +++ b/accelerated-moblie-pages.php @@ -3,7 +3,7 @@ Plugin Name: Accelerated Mobile Pages Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/ Description: AMP for WP - Accelerated Mobile Pages for WordPress -Version: 1.0.22 +Version: 1.0.24 Author: Ahmed Kaludi, Mohammed Kaludi Author URI: https://ampforwp.com/ Donate link: https://www.paypal.me/Kaludi/25 @@ -20,7 +20,7 @@ define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html'); define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images'); define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) ); -define('AMPFORWP_VERSION','1.0.22'); +define('AMPFORWP_VERSION','1.0.24'); define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions'); if(!defined('AMPFROWP_HOST_NAME')){ $urlinfo = get_bloginfo('url'); diff --git a/changelog.txt b/changelog.txt index f7fc88a5f..2bfee2e9b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,29 @@ == Changelog == += 1.0.24 (11th February 2020) = +* Improvement: Added filter to modify the breadcrumb homepage url #4077 +* Fixed: Image alignment on the left issue #4156 +* Fixed: H1 tag not appearing on posts #4121 +* Fixed: "Title on static page front page" option not working #4138 +* Fixed: AMP Menu option was not showing in WP settings #4129 +* Fixed: Blank Events Calendar Months Page when 'Minify' option is enabled #4080 +* Fixed: Removed '@' in Twitter Handle #4135 +* Fixed: Message improved when "Leverage Browser Caching" option is enable without readable or writable permission of htaccess file #4127 +* Fixed: Featured image removed on AMP Pagebuilder pages #4131 + += 1.0.23 (7th February 2020) = +* Fixed: Fatal error in amp theme framework if WordPress directory is modified #4145 +* Fixed: Iframe error due to Jetpack #4125 +* Fixed: Menu transient increased to avoid deadlock error #4133 +* Fixed: Moved "Breadcrumbs From Yoast" to SEO option Panel section. #3600 +* Fixed: Featured Image from the content is not fetching the image when height and width is not present in the image code in Classic editor. #4096 +* Improvement: Sorting option for Pagebuilder slider/gallery #2014 +* Improvement: Option for showing no. of words in the excerpt of Recent Posts and Related Posts #3640 +* Improvement: Link Comments section with comments order #3740 +* Improvement: Default fallback images Added #3719 +* Improvement: subscript and superscript support #4137 +* Improvement: Message added if no seo option is selected but seo plugin is active #4124 + = 1.0.22 (6th February 2020) = * Fixed: Console error - Uncaught TypeError: Cannot read property 'on' of null #4102 * Fixed: When Insert post ads plugin is enable then AMP settings panel is not showing. #4107 diff --git a/components/breadcrumb/breadcrumb.php b/components/breadcrumb/breadcrumb.php index e7da07b5c..362a69e8d 100644 --- a/components/breadcrumb/breadcrumb.php +++ b/components/breadcrumb/breadcrumb.php @@ -34,10 +34,10 @@ function amp_breadcrumb_output(){ // Build the breadcrums echo '
    '; - + $home_url = ampforwp_url_controller( get_home_url('', '/'), $home_non_amp ); + $home_url = apply_filters('ampforwp_breadcrumbs_home_url',$home_url,$post->ID); // Home page - echo '
  • ' . esc_html($home_title) . '
  • '; - + echo '
  • ' . esc_html($home_title) . '
  • '; if ( is_archive() && !is_tax() && !is_category() && !is_tag() && !is_author() ) { @@ -135,6 +135,7 @@ function amp_breadcrumb_output(){ if(ampforwp_get_setting('ampforwp-archive-support-cat') == true && ampforwp_get_setting('ampforwp-archive-support') == true){ $cat_link = ampforwp_url_controller( $cat_link ); } + $cat_link = apply_filters('ampforwp_breadcrumbs_category_url', $cat_link,$post->ID); $cat_display .= '
  • ' . esc_html($parents) . '
  • '; } if(ampforwp_get_setting('ampforwp-bread-crumb-post')){ diff --git a/components/comments/comments.php b/components/comments/comments.php index 9bd9f8e77..4d6f082f8 100644 --- a/components/comments/comments.php +++ b/components/comments/comments.php @@ -31,8 +31,10 @@ function ampforwp_framework_get_comments(){ if ( ampforwp_is_front_page() ) { $postID = ampforwp_get_frontpage_id(); } + $comment_order = get_option( 'comment_order' ); $comments = get_comments(array( 'post_id' => $postID, + 'order' => esc_attr($comment_order), 'status' => 'approve' //Change this to the type of comments to be displayed )); diff --git a/components/components-core.php b/components/components-core.php index 3f86b730e..a9ef4b1a7 100644 --- a/components/components-core.php +++ b/components/components-core.php @@ -105,23 +105,19 @@ function amp_logo(){ // Title function amp_title(){ - global $redux_builder_amp, $post; - $ID = ''; - if( ampforwp_is_front_page() && ampforwp_get_frontpage_id() ){ - if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { - $ID = ampforwp_get_frontpage_id(); - } - } - elseif ( ampforwp_polylang_front_page() ) { + global $post; + $ID = null; + if ( ampforwp_polylang_front_page() ) { $ID = pll_get_post(get_option('page_on_front')); } - else - $ID = $post->ID; + elseif( ampforwp_get_setting('ampforwp-title-on-front-page') ) { + $ID = ampforwp_get_the_ID(); + } if( $ID!=null ){ do_action('ampforwp_above_the_title'); $ampforwp_title = get_the_title($ID); $ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title); - if(!empty($ampforwp_title) && ampforwp_default_logo()){ + if(!empty($ampforwp_title) && (ampforwp_default_logo() || !empty(ampforwp_get_setting('opt-media','url')))){ ?>

    .rtl amp-carousel {direction: ltr;} .rtl .amp-menu .toggle:after{left:0;right:unset;} .sharedaddy li{display:none} + sub {vertical-align: sub;font-size: small;} + sup {vertical-align: super;font-size: small;} .btt{ position: fixed; diff --git a/components/menu/menu.php b/components/menu/menu.php index 6b0d76ef3..04aa0b155 100644 --- a/components/menu/menu.php +++ b/components/menu/menu.php @@ -38,10 +38,10 @@ function amp_menu_html($echo, $menu_args, $type){ $menu_cache = apply_filters('ampforwp_menu_cache',$menu_cache); if ($menu_cache) { if ( 'header' == $type ) { - set_transient('ampforwp_header_menu', $sanitized_menu, 24*HOUR_IN_SECONDS ); + set_transient('ampforwp_header_menu', $sanitized_menu, 14*DAY_IN_SECONDS ); } elseif ('footer' == $type) { - set_transient('ampforwp_footer_menu', $sanitized_menu, 24*HOUR_IN_SECONDS ); + set_transient('ampforwp_footer_menu', $sanitized_menu, 15*DAY_IN_SECONDS ); } } return $sanitized_menu; diff --git a/components/theme-loader.php b/components/theme-loader.php index d88602e3a..806fa7482 100644 --- a/components/theme-loader.php +++ b/components/theme-loader.php @@ -4,7 +4,7 @@ } $amp_main_dir = AMPFORWP_PLUGIN_DIR . 'templates/design-manager/swift'; if ( 4 != $ampforwp_design_selector ) { - $amp_main_dir = ABSPATH.'wp-content/plugins/'. esc_attr($ampforwp_design_selector); + $amp_main_dir = WP_PLUGIN_DIR.'/'. esc_attr($ampforwp_design_selector); } $amp_theme_dir = apply_filters('ampforwp_theme_dir', $amp_main_dir); if ( ! is_dir($amp_theme_dir)) { diff --git a/includes/features/performance/performance-functions.php b/includes/features/performance/performance-functions.php index daf966e03..ffac5102b 100644 --- a/includes/features/performance/performance-functions.php +++ b/includes/features/performance/performance-functions.php @@ -69,7 +69,17 @@ function ampforwp_minify_html_output($content_buffer){ $asis = ''; } - $process = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/\s+/' ), array('> ', ' <', ' '), $process); + if(function_exists('tec_amp_compatibility_orgs_venues_support')){ + global $wp; + $current_url = home_url(add_query_arg(array($_GET), $wp->request)); + if(preg_match('/months/', $current_url)){ + $process = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/\s+/' ), array('> ', ' <', ' '), $process); + }else{ + $process = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/\s+/' ), array('> ', ' <', ' '), $process); + } + }else{ + $process = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/\s+/' ), array('> ', ' <', ' '), $process); + } if ( $minify_html_comments != 'no' ) $process = preg_replace('/).)*-->' . $mod, '', $process); @@ -153,7 +163,7 @@ function ampforwp_leverage_browser_caching(){ function ampforwp_no_htaccess_access_notice(){ $message = '

    '; - $message .= esc_html__( 'Accelerated Mobile Pages: htaccess file is not readable or writable for Leverage Browser Caching. Please change permission of htaccess file.', 'accelerated-mobile-pages' ); + $message .= sprintf( 'Accelerated Mobile Pages: htaccess file is not readable or writable for Leverage Browser Caching. Please change permission of htaccess file and for more info %s',esc_html__('Click Here','accelerated-mobile-pages' )); $message .= '

    '; echo wp_kses_post( $message ); } diff --git a/includes/includes.php b/includes/includes.php index 2da5222d6..82fd218d6 100644 --- a/includes/includes.php +++ b/includes/includes.php @@ -15,7 +15,7 @@ // 1.1 AMP Header menu if (! function_exists( 'ampforwp_menu') ) { function ampforwp_menu() { - if(ampforwp_get_setting('ampforwp-amp-menu-swift') == true) { + if(ampforwp_get_setting('ampforwp-amp-menu-swift') == true || (ampforwp_design_selector()!=4 && true == ampforwp_get_setting('ampforwp-amp-menu'))) { register_nav_menus( array( 'amp-menu' => esc_html__( 'AMP Menu','accelerated-mobile-pages' ), diff --git a/includes/options/admin-config.php b/includes/options/admin-config.php index b24ccd65c..12503e9a2 100644 --- a/includes/options/admin-config.php +++ b/includes/options/admin-config.php @@ -1986,6 +1986,17 @@ function ampforwp_seo_default() { 'default' => 0, 'required' => array('ampforwp-seo-selection', '=' , 'yoast'), ), + array( + 'id' => 'ampforwp-yoast-bread-crumb', + 'class' => 'child_opt child_opt_arrow', + 'type' => 'switch', + 'default' => false, + 'title' => esc_html__('Breadcrumbs From Yoast', 'accelerated-mobile-pages'), + 'required' => array( + array('ampforwp-bread-crumb', '=' , '1'), + array('ampforwp-seo-selection', '=' , 'yoast') + ), + ), array( 'class' => 'child_opt', 'id' => 'ampforwp-seo-yoast-schema', @@ -2765,6 +2776,15 @@ function ampforwp_featured_video_default(){ 'false' => 'false', 'default' => 0, ), + // DEFAULT FALLBACK IMAGE + array( + 'id' => 'ampforwp_default_fallback_image', + 'type' => 'media', + 'url' => true, + 'title' => esc_html__('Default Fallback Image', 'accelerated-mobile-pages'), + 'tooltip-subtitle'=>esc_html__('Update the image you want show as default fallback image)', 'accelerated-mobile-pages'), + 'default' => array('url' => AMPFORWP_IMAGE_DIR . '/SD-default-image.png' ), + ), // Retina Images array( 'id' => 'ampforwp-retina-images', @@ -5303,17 +5323,6 @@ function ampforwp_get_element_default_color() { ), ) )); -$yoast_breadcrumbs = ''; -if ( defined('WPSEO_FILE') ) { - $yoast_breadcrumbs = array( - 'id' => 'ampforwp-yoast-bread-crumb', - 'type' => 'switch', - 'default' => false, - 'title' => esc_html__('Breadcrumbs From Yoast', 'accelerated-mobile-pages'), - 'required' => array('ampforwp-bread-crumb' , '=' , 1), - 'class' => 'child_opt child_opt_arrow', - ); -} if(!is_plugin_active( 'amp-newspaper-theme/ampforwp-custom-theme.php' ) ){ $single_page_options = array( array( @@ -5451,7 +5460,6 @@ function ampforwp_get_element_default_color() { 'default' => '0', 'required' => array('ampforwp-bread-crumb' , '=' , 1), ), - $yoast_breadcrumbs, //Categories ON/OFF array( 'id' => 'ampforwp-cats-single', @@ -5613,6 +5621,19 @@ function ampforwp_get_element_default_color() { 'tooltip-subtitle' => esc_html__('Enable this option to show excerpt for each post of Recent post loop'), 'required' => array('ampforwp-swift-recent-posts' , '=' , '1'), ), + array( + 'id' =>'amp-swift-recentpost-excerpt-len', + 'class' => 'child_opt', + 'type' =>'text', + 'tooltip-subtitle' => esc_html__('Enter the number of words Eg: 15','accelerated-mobile-pages'), + 'title' => esc_html__('Excerpt Length','accelerated-mobile-pages'), + 'required' => array( + array('amp-design-selector', '=' , '4'), + array('amforwp-recentpost-excerpt-switch', '=' , '1'), + ), + 'validate' =>'numeric', + 'default' =>'15', + ), array( 'id' => 'ampforwp-recentpost-posts-link', 'type' => 'switch', @@ -5822,6 +5843,28 @@ function ampforwp_get_element_default_color() { 'tooltip-subtitle' => esc_html__('Enable this option to show image for each post of Recent post loop'), 'required' => array('ampforwp-design3-recent-posts' , '=' , '1'), ), + array( + 'id' => 'amforwp-design3-recentpost-excerpt-switch', + 'type' => 'switch', + 'class' => 'child_opt child_opt_arrow', + 'title' => esc_html__('Excerpt', 'accelerated-mobile-pages'), + 'default' => 1, + 'tooltip-subtitle' => esc_html__('Enable this option to show excerpt for each post of Recent post loop'), + 'required' => array('ampforwp-design3-recent-posts' , '=' , '1'), + ), + array( + 'id' =>'amp-design3-recentpost-excerpt-len', + 'class' => 'child_opt', + 'type' =>'text', + 'tooltip-subtitle' => esc_html__('Enter the number of words Eg: 15','accelerated-mobile-pages'), + 'title' => esc_html__('Excerpt Length','accelerated-mobile-pages'), + 'required' => array( + array('amp-design-selector', '=' , '3'), + array('amforwp-design3-recentpost-excerpt-switch', '=' , '1'), + ), + 'validate' =>'numeric', + 'default' =>'15', + ), array( 'id' => 'ampforwp-design3-number-of-recent-posts', 'type' => 'text', @@ -7046,7 +7089,7 @@ function ampforwp_get_element_default_color() { 'class' => 'child_opt', 'title' => esc_html__('Twitter Handle', 'accelerated-mobile-pages'), 'required' => array('enable-single-twitter-share', '=' , '1'), - 'placeholder' => esc_html__('Eg: @xyx','accelerated-mobile-pages'), + 'placeholder' => esc_html__('username','accelerated-mobile-pages'), 'default' => '', ), array( diff --git a/pagebuilder/components/modulePopupTemplate.php b/pagebuilder/components/modulePopupTemplate.php index a83c40e38..762b81b51 100644 --- a/pagebuilder/components/modulePopupTemplate.php +++ b/pagebuilder/components/modulePopupTemplate.php @@ -2,28 +2,28 @@ if ( ! defined( 'ABSPATH' ) ) exit; ?>