Skip to content

Commit

Permalink
Merge pull request #4164 from ahmedkaludi/1.0-deploy
Browse files Browse the repository at this point in the history
Merge 1.0.24 into master
  • Loading branch information
MohammedKaludi committed Feb 11, 2020
2 parents 75e5e5d + 2375f2f commit a7cd5c6
Show file tree
Hide file tree
Showing 32 changed files with 378 additions and 168 deletions.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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<sub> and superscript<sup> 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
Expand All @@ -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)
4 changes: 2 additions & 2 deletions accelerated-moblie-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand Down
24 changes: 24 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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<sub> and superscript<sup> 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
Expand Down
7 changes: 4 additions & 3 deletions components/breadcrumb/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function amp_breadcrumb_output(){

// Build the breadcrums
echo '<ul id="' . esc_attr($breadcrums_id) . '" class="' . esc_attr($breadcrums_class) . '">';

$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 '<li class="item-home"><a class="bread-link bread-home" href="' . ampforwp_url_controller( get_home_url('', '/'), $home_non_amp ) . '" title="' . esc_attr($home_title) . '">' . esc_html($home_title) . '</a></li>';

echo '<li class="item-home"><a class="bread-link bread-home" href="' . esc_url($home_url) . '" title="' . esc_attr($home_title) . '">' . esc_html($home_title) . '</a></li>';
if ( is_archive() && !is_tax() && !is_category() && !is_tag() && !is_author() ) {


Expand Down Expand Up @@ -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 .= '<li class="item-cat item-cat-' . esc_attr($cat_id) . '"><a class="bread-cat bread-cat-' . esc_attr($cat_id) . ' bread-cat-' . $parents. '" href="'. esc_url($cat_link).'" title="' . esc_attr($parents) . '">' . esc_html($parents) . '</a></li>';
}
if(ampforwp_get_setting('ampforwp-bread-crumb-post')){
Expand Down
2 changes: 2 additions & 0 deletions components/comments/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
));

Expand Down
20 changes: 9 additions & 11 deletions components/components-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')))){
?>
<h1 class="amp-post-title"><?php echo wp_kses_data( $ampforwp_title ); ?></h1>
<?php
Expand Down Expand Up @@ -707,6 +703,8 @@ function ampforwp_backtotop_global_css(){?>
.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;}
<?php if( true == ampforwp_get_setting('ampforwp-footer-top') ) { ?>
.btt{
position: fixed;
Expand Down
4 changes: 2 additions & 2 deletions components/menu/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/theme-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
14 changes: 12 additions & 2 deletions includes/features/performance/performance-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->' . $mod, '', $process);
Expand Down Expand Up @@ -153,7 +163,7 @@ function ampforwp_leverage_browser_caching(){

function ampforwp_no_htaccess_access_notice(){
$message = '<div class="error"><p>';
$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 <a href="https://ampforwp.com/tutorials/article/how-to-fix-leverage-browser-caching-error/" target="_blank">%s</a>',esc_html__('Click Here','accelerated-mobile-pages' ));
$message .= '</p></div>';
echo wp_kses_post( $message );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down
69 changes: 56 additions & 13 deletions includes/options/admin-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a7cd5c6

Please sign in to comment.