Skip to content

Commit

Permalink
0.7.6 Release
Browse files Browse the repository at this point in the history
- Google Adsense Support Added with AMP-Ad
- Wrong Homepage rel amphtml bug fixed
  • Loading branch information
ahmedkaludi committed Aug 15, 2016
1 parent 7139963 commit ae1449d
Show file tree
Hide file tree
Showing 27 changed files with 1,663 additions and 30 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ https://wordpress.org/plugins/accelerated-mobile-pages/

=== AMP - Accelerated Mobile Pages ===
Contributors: mohammed_kaludi, ahmedkaludi
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp, google
Requires at least: 3.0
Tested up to: 4.5.3
Stable tag: 0.7.5
Stable tag: 0.7.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -22,6 +22,7 @@ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on
**Features:**

* Automatically integrate AMP to your website
* Google Adsense (AMP-AD) Support with 4 different Ad slots across the layout! The First Plugin to have this capability.
* Google Analytics Support
* User Friendly Theme Options Panel
* Unlimited Color Scheme
Expand All @@ -35,7 +36,7 @@ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on
* Great Support & Active Development


**NOTE: Next Big Update of this plugin will be released on 7th September 2016.
**NOTE: Next Big Update of this plugin will be released before 7th September 2016.


**How to test if AMP is working or not?**
Expand Down Expand Up @@ -133,4 +134,8 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
* Color Scheme Feature Added
* User friendly Options Panel Added
* iFrame support Added
* Few Minor Bugs Fixed
* Few Minor Bugs Fixed

= 0.7.6 =
* Google Adsense Support Added with AMP-Ad
* Wrong Homepage rel amphtml bug fixed
17 changes: 13 additions & 4 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: Accelerated Mobile Pages for WordPress
Version: 0.7.5
Version: 0.7.6
Author: Ahmed Kaludi, Mohammed Kaludi
Author URI: http://AhmedKaludi.com/
License: GPL2
Expand Down Expand Up @@ -31,12 +31,21 @@
* Add "amphtml" in the main theme to target it to the AMP page
*/

function add_rel_info() {
function add_rel_info() {
$amp_url = trailingslashit( get_permalink() );
?>
<link rel="amphtml" href="<?php echo $amp_url; ?>?amp" />

<?php // TO DO: Add support for archives, and other parts and stuff..
if ( is_home() ) { ?>
<link rel="amphtml" href="<?php echo get_home_url(); ?>?amp" />
<?php } else { ?><link rel="amphtml" href="<?php echo $amp_url; ?>?amp" />
<?php }
add_action( 'wp_head', 'add_rel_info' );
}

// This is not the blog posts index
add_action( 'wp_head', 'add_rel_info' );




// Registering Custom AMP menu for this plugin
Expand Down
225 changes: 212 additions & 13 deletions options/options-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'page_slug' => 'amp_options',
'page_title' => 'Accelerated Mobile Pages Options',
'update_notice' => false,
'intro_text' => '<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank">Support Forum</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/faq/" target="_blank">FAQ</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/changelog/" target="_blank">Change Log</a> | <a href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages" target="_blank">Reviews</a>',
'intro_text' => '<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank">Need Help? Support Forum</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/faq/" target="_blank">FAQ</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/changelog/" target="_blank">Change Log</a> | <a href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages" target="_blank">Reviews</a>',
'footer_text' => '',
'admin_bar' => TRUE,
'menu_type' => 'menu',
Expand Down Expand Up @@ -188,21 +188,33 @@
'url' => true,
'title' => __('Logo', 'redux-framework-demo'),
//'desc' => __('', 'redux-framework-demo'),
'subtitle' => __('Upload a logo for the AMP version. Recommend logo size is: 190x36', 'redux-framework-demo'),
'desc' => __('Upload a logo for the AMP version. Recommend logo size is: 190x36', 'redux-framework-demo'),
// 'default' => array(
// 'url'=>'http://s.wordpress.org/style/images/codeispoetry.png'
// ),
),
array(
'id' => 'ga-feild',
'type' => 'text',
'title' => __( 'Google Analytics', 'redux-framework-demo' ),
'subtitle' => __( '', 'redux-framework-demo' ),
'desc' => __( 'Enter your Google Analytics ID. Example: UA-XXXXX-Y.', 'redux-framework-demo' ),
'default' => 'UA-XXXXX-Y',
),


),

//$fields = array(
// 'id' => 'opt-switch',
// 'type' => 'switch',
// 'title' => __('Switch On', 'redux-framework-demo'),
// 'subtitle' => __('Look, it\'s on!', 'redux-framework-demo'),
// 'default' => true
//),


//
//
array(
'id' => 'ga-feild',
'type' => 'text',
'title' => __( 'Google Analytics', 'redux-framework-demo' ),
'subtitle' => __( '', 'redux-framework-demo' ),
'desc' => __( 'Enter your Google Analytics ID. Example: UA-XXXXX-Y.', 'redux-framework-demo' ),
'default' => 'UA-XXXXX-Y',
),
//
//

array(
'id' => 'opt-color-rgba',
Expand Down Expand Up @@ -246,6 +258,193 @@

) );

// ADS SECTION
Redux::setSection( $opt_name, array(
'title' => __( 'Advertisement', 'redux-framework-demo' ),
'desc' => __( 'The First and Only plugin to be the Adsense AMP-AD compatible!'),
'id' => 'amp-ads',
'subsection' => true,
'fields' => array(
array(
'id'=>'enable-amp-ads-1',
'type' => 'switch',
'title' => __('AD #1', 'redux-framework-demo'),
"default" => 0,
'subtitle' => __('Below the Header (SiteWide)', 'redux-framework-demo'),
'true' => 'Enabled',
'false' => 'Disabled',
),

array(
'id' => 'enable-amp-ads-select-1',
'type' => 'select',
'title' => __('AD Size', 'redux-framework-demo'),
'required' => array('enable-amp-ads-1', '=' , '1'),
// Must provide key => value pairs for select options
'options' => array(
'1' => '300x250',
'2' => '336x280',
'3' => '728x90',
'4' => '300x600',
'5' => '320x100'
),
'default' => '2',
),

array(
'id'=>'enable-amp-ads-text-feild-client-1',
'type' => 'text',
'required' => array('enable-amp-ads-1', '=' , '1'),
'title' => __('Data AD Client', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
'default' => ''
),
array(
'id' => 'enable-amp-ads-text-feild-slot-1',
'type' => 'text',
'title' => __('Data AD Slot', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
'default' => '',
'required' => array('enable-amp-ads-1', '=' , '1'),
),

//2 ad start
array(
'id'=>'enable-amp-ads-2',
'type' => 'switch',
'title' => __('AD #2', 'redux-framework-demo'),
"default" => 0,
'subtitle' => __('Below the Post title (Single Post)', 'redux-framework-demo'),
'true' => 'Enabled',
'false' => 'Disabled',
),

array(
'id' => 'enable-amp-ads-select-2',
'type' => 'select',
'title' => __('AD Size', 'redux-framework-demo'),
'required' => array('enable-amp-ads-2', '=' , '1'),
// Must provide key => value pairs for select options
'options' => array(
'1' => '300x250',
'2' => '336x280',
'3' => '728x90',
'4' => '300x600',
'5' => '320x100'
),
'default' => '2',
),

array(
'id'=>'enable-amp-ads-text-feild-client-2',
'type' => 'text',
'required' => array('enable-amp-ads-2', '=' , '1'),
'title' => __('Data AD Client', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
'default' => ''
),
array(
'id' => 'enable-amp-ads-text-feild-slot-2',
'type' => 'text',
'title' => __('Data AD Slot', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
'default' => '',
'required' => array('enable-amp-ads-2', '=' , '1'),
),
// 2 ad end
//3 ad start
array(
'id'=>'enable-amp-ads-3',
'type' => 'switch',
'title' => __('AD #3', 'redux-framework-demo'),
"default" => 0,
'subtitle' => __('Below the Post Content (Single Post)', 'redux-framework-demo'),
'true' => 'Enabled',
'false' => 'Disabled',
),

array(
'id' => 'enable-amp-ads-select-3',
'type' => 'select',
'title' => __('AD Size', 'redux-framework-demo'),
'required' => array('enable-amp-ads-3', '=' , '1'),
// Must provide key => value pairs for select options
'options' => array(
'1' => '300x250',
'2' => '336x280',
'3' => '728x90',
'4' => '300x600',
'5' => '320x100'
),
'default' => '2',
),

array(
'id'=>'enable-amp-ads-text-feild-client-3',
'type' => 'text',
'required' => array('enable-amp-ads-3', '=' , '1'),
'title' => __('Data AD Client', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
'default' => ''
),
array(
'id' => 'enable-amp-ads-text-feild-slot-3',
'type' => 'text',
'title' => __('Data AD Slot', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
'default' => '',
'required' => array('enable-amp-ads-3', '=' , '1'),
),
// 3 ad end
//4 ad start
array(
'id'=>'enable-amp-ads-4',
'type' => 'switch',
'title' => __('AD #4', 'redux-framework-demo'),
"default" => 0,
'subtitle' => __('Below the Footer (SiteWide)', 'redux-framework-demo'),
'true' => 'Enabled',
'false' => 'Disabled',
),

array(
'id' => 'enable-amp-ads-select-4',
'type' => 'select',
'title' => __('AD Size', 'redux-framework-demo'),
'required' => array('enable-amp-ads-4', '=' , '1'),
// Must provide key => value pairs for select options
'options' => array(
'1' => '300x250',
'2' => '336x280',
'3' => '728x90',
'4' => '300x600',
'5' => '320x100'
),
'default' => '2',
),

array(
'id'=>'enable-amp-ads-text-feild-client-4',
'type' => 'text',
'required' => array('enable-amp-ads-4', '=' , '1'),
'title' => __('Data AD Client', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
'default' => ''
),
array(
'id' => 'enable-amp-ads-text-feild-slot-4',
'type' => 'text',
'title' => __('Data AD Slot', 'redux-framework-demo'),
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
'default' => '',
'required' => array('enable-amp-ads-4', '=' , '1'),
)
// 3 ad end
),

) );

// CSS
Redux::setSection( $opt_name, array(
'title' => __( 'Custom CSS Editor', 'redux-framework-demo' ),
// 'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
Expand Down
34 changes: 34 additions & 0 deletions options/redux-framework/assets/css/redux-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ae1449d

Please sign in to comment.