Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 7a3c74f3892d37102f49e93fd79acebddda6eaed 2 parents f709367 + 89e8260
@nickdaugherty nickdaugherty authored
View
38 ad-code-manager.php
@@ -4,7 +4,7 @@
Plugin URI: http://automattic.com
Description: Easy ad code management
Author: Rinat Khaziev, Jeremy Felt, Daniel Bachhuber, Automattic, doejo
-Version: 0.4
+Version: 0.5-alpha
Author URI: http://automattic.com
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
@@ -24,7 +24,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-define( 'AD_CODE_MANAGER_VERSION', '0.4' );
+define( 'AD_CODE_MANAGER_VERSION', '0.5-alpha' );
define( 'AD_CODE_MANAGER_ROOT' , dirname( __FILE__ ) );
define( 'AD_CODE_MANAGER_FILE_PATH' , AD_CODE_MANAGER_ROOT . '/' . basename( __FILE__ ) );
define( 'AD_CODE_MANAGER_URL' , plugins_url( '/', __FILE__ ) );
@@ -224,15 +224,15 @@ function get_options() {
$default_provider = 'doubleclick_for_publishers';
// Make sure our default provider exists. Otherwise, the sky will fall on our head
if ( ! isset( $this->providers->$default_provider ) ) {
- foreach( $this->providers as $slug => $provider ) {
+ foreach ( $this->providers as $slug => $provider ) {
$default_provider = $slug;
break;
}
}
$defaults = array(
- 'provider' => $default_provider,
- );
+ 'provider' => $default_provider,
+ );
$options = get_option( 'acm_options', array() );
return array_merge( $defaults, $options );
}
@@ -336,7 +336,7 @@ function handle_admin_action() {
break;
case 'update_options':
$options = $this->get_options();
- foreach( $options as $key => $value ) {
+ foreach ( $options as $key => $value ) {
if ( isset( $_REQUEST[$key] ) )
$options[$key] = sanitize_text_field( $_REQUEST[$key] );
}
@@ -639,7 +639,7 @@ function parse_readme_into_contextual_help() {
if ( 5 > count( $sections ) )
return;
- $useful = array( $sections[3], $sections[2], $sections[4] );
+ $useful = array( $sections[2], $sections[4], $sections[7] );
foreach ( $useful as $i => $tab ) {
// Because WP.ORG Markdown has a different flavor
$useful[$i] = Markdown( str_replace( array( '= ', ' =' ), '**', $tab ) );
@@ -651,7 +651,7 @@ function contextual_help() {
global $pagenow;
if ( 'tools.php' != $pagenow || !isset( $_GET['page'] ) || $_GET['page'] != $this->plugin_slug )
return;
- list( $installation, $description, $configuration ) = $this->parse_readme_into_contextual_help();
+ list( $description, $configuration, $filters ) = $this->parse_readme_into_contextual_help();
ob_start();
?>
<div id="conditionals-help">
@@ -690,16 +690,16 @@ function contextual_help() {
);
get_current_screen()->add_help_tab(
array(
- 'id' => 'acm-install',
- 'title' => 'Installation',
- 'content' => $installation,
+ 'id' => 'acm-config',
+ 'title' => 'Configuration',
+ 'content' => $configuration,
)
);
get_current_screen()->add_help_tab(
array(
- 'id' => 'acm-config',
- 'title' => 'Configuration',
- 'content' => $configuration,
+ 'id' => 'acm-filters',
+ 'title' => 'Configuration Filters',
+ 'content' => $filters,
)
);
get_current_screen()->add_help_tab(
@@ -805,7 +805,7 @@ function register_ad_codes( $ad_codes = array() ) {
/**
* 'enable_ui_mapping' is a special argument which means this ad tag can be
* mapped with ad codes through the admin interface. If that's the case, we
- * want to make sure those ad codes are only registered with the tag.
+ * want to make sure those ad codes are only registered with the tag.
*/
if ( isset( $default_tag['enable_ui_mapping'] ) && $default_tag['tag'] != $ad_code['url_vars']['tag'] )
continue;
@@ -836,6 +836,14 @@ function register_ad_codes( $ad_codes = array() ) {
* @param string $tag_id Unique ID for the ad tag
*/
function action_acm_tag( $tag_id ) {
+ /**
+ * See http://adcodemanager.wordpress.com/2013/04/10/hi-all-on-a-dotcom-site-that-uses/
+ *
+ * Configuration filter: acm_disable_ad_rendering
+ * Should be boolean, defaulting to disabling ads on previews
+ */
+ if ( apply_filters( 'acm_disable_ad_rendering', is_preview() ) )
+ return;
$code_to_display = $this->get_matching_ad_code( $tag_id );
View
4 common/lib/acm-wp-list-table.php
@@ -228,7 +228,7 @@ function column_id( $item ) {
$ad_code_arg = array_shift( wp_filter_object_list( $ad_code_args, array( 'key' => $slug ) ) );
if ( isset( $ad_code_arg['type'] ) && 'select' == $ad_code_arg['type'] ) {
$output .= '<select name="' . esc_attr( $column_id ) . '">';
- foreach( $ad_code_arg['options'] as $key => $label ) {
+ foreach ( $ad_code_arg['options'] as $key => $label ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $value, $key, false ) . '>' . esc_attr( $label ) . '</option>';
}
$output .= '</select>';
@@ -347,4 +347,4 @@ function inline_edit() {
<?php
}
-}
+}
View
3,046 common/lib/markdown.php
1,518 additions, 1,528 deletions not shown
View
70 common/views/ad-code-manager.tpl.php
@@ -6,26 +6,26 @@
<div class="acm-ui-wrapper wrap">
<h2>Ad Code Manager</h2>
<?php if ( isset( $_REQUEST['message'] ) ) {
- switch( $_REQUEST['message'] ) {
- case 'ad-code-added':
- $message_text = __( 'Ad code created.', 'ad-code-manager' );
- break;
- case 'ad-code-deleted':
- $message_text = __( 'Ad code deleted.', 'ad-code-manager' );
- break;
- case 'ad-codes-deleted':
- $message_text = __( 'Ad codes deleted.', 'ad-code-manager' );
- break;
- case 'options-saved':
- $message_text = __( 'Options saved.', 'ad-code-manager' );
- break;
- default:
- $message_text = '';
- break;
- }
- if ( $message_text )
- echo '<div class="message updated"><p>' . esc_html( $message_text ) . '</p></div>';
- } ?>
+ switch ( $_REQUEST['message'] ) {
+ case 'ad-code-added':
+ $message_text = __( 'Ad code created.', 'ad-code-manager' );
+ break;
+ case 'ad-code-deleted':
+ $message_text = __( 'Ad code deleted.', 'ad-code-manager' );
+ break;
+ case 'ad-codes-deleted':
+ $message_text = __( 'Ad codes deleted.', 'ad-code-manager' );
+ break;
+ case 'options-saved':
+ $message_text = __( 'Options saved.', 'ad-code-manager' );
+ break;
+ default:
+ $message_text = '';
+ break;
+ }
+ if ( $message_text )
+ echo '<div class="message updated"><p>' . esc_html( $message_text ) . '</p></div>';
+} ?>
<p> Refer to help section for more information</p>
</div>
@@ -36,9 +36,9 @@
<div class="col-wrap">
<form action="" method="post" name="updateadcodes" id="updateadcodes">
<?php
- wp_nonce_field( 'acm-bulk-action', 'bulk-action-nonce' );
- $this->wp_list_table->prepare_items();
- $this->wp_list_table->display();
+wp_nonce_field( 'acm-bulk-action', 'bulk-action-nonce' );
+$this->wp_list_table->prepare_items();
+$this->wp_list_table->display();
?>
</form>
@@ -61,12 +61,12 @@
<label for="provider"><?php _e( 'Select a provider:', 'ad-code-manager' ); ?></label>
<select name="provider" id="provider">
<?php $current_provider = $this->get_option( 'provider' );
- foreach ( $this->providers as $slug => $provider ) :
- if ( isset( $provider['label'] ) )
- $label = $provider['label'];
- else
- $label = ucwords( str_replace( '_', ' ', $slug ) );
- ?>
+foreach ( $this->providers as $slug => $provider ) :
+ if ( isset( $provider['label'] ) )
+ $label = $provider['label'];
+ else
+ $label = ucwords( str_replace( '_', ' ', $slug ) );
+?>
<option value="<?php echo esc_attr( $slug ); ?>" <?php selected( $slug, $current_provider ); ?>><?php echo esc_html( $label ); ?></option>
<?php endforeach; ?>
</select>
@@ -94,12 +94,12 @@
$column_id = 'acm-column[' . $arg['key'] . ']';
- /*
+/*
* Field type conditional: Defaults to text
*
* For specific implementations, allow the user to choose which tag the ad code applies to.
*/
- if ( isset( $arg['type'] ) && 'select' == $arg['type'] ) :
+if ( isset( $arg['type'] ) && 'select' == $arg['type'] ) :
?>
<div class="form-field form-required">
<label for="<?php echo esc_attr( $column_id ) ?>"><?php echo esc_html( $arg['label'] ) ?></label>
@@ -110,8 +110,8 @@
</select>
</div>
<?php
- else : // field_type conditional
- ?>
+else : // field_type conditional
+?>
<div class="form-field form-required">
<label for="<?php echo esc_attr( $column_id ) ?>"><?php echo esc_html( $arg['label'] ) ?></label>
<input name="<?php echo esc_attr( $column_id ) ?>" id="<?php echo esc_attr( $column_id ) ?>" type="text" value="" size="40" aria-required="<?php echo $arg['required'] ?>">
@@ -130,7 +130,7 @@
<?php
foreach ( $this->whitelisted_conditionals as $key ):
?>
-<option value="<?php echo esc_attr($key) ?>"><?php echo esc_html( ucfirst( str_replace('_', ' ', $key ) ) ) ?></option>
+<option value="<?php echo esc_attr( $key ) ?>"><?php echo esc_html( ucfirst( str_replace( '_', ' ', $key ) ) ) ?></option>
<?php endforeach; ?>
</select>
</div>
@@ -153,4 +153,4 @@
<?php $this->wp_list_table->inline_edit(); ?>
</div>
-</div>
+</div>
View
103 languages/ad-code-manager.pot
@@ -1,30 +1,30 @@
-# Copyright (C) 2012 Ad Code Manager
+# Copyright (C) 2013 Ad Code Manager
# This file is distributed under the same license as the Ad Code Manager package.
msgid ""
msgstr ""
-"Project-Id-Version: Ad Code Manager 0.3-working\n"
+"Project-Id-Version: Ad Code Manager 0.4\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/ad-code-manager\n"
-"POT-Creation-Date: 2012-10-26 01:27:39+00:00\n"
+"POT-Creation-Date: 2013-04-16 05:02:49+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-#: ad-code-manager.php:152
+#: ad-code-manager.php:154
msgid "Ad Codes"
msgstr ""
-#: ad-code-manager.php:153
+#: ad-code-manager.php:155
msgid "Ad Code"
msgstr ""
-#: ad-code-manager.php:216
+#: ad-code-manager.php:276
msgid "Doing something fishy, eh?"
msgstr ""
-#: ad-code-manager.php:219
+#: ad-code-manager.php:279
msgid "You do not have the necessary permissions to perform this action"
msgstr ""
@@ -45,33 +45,38 @@ msgid "No ad codes have been added yet. <a href='%s'>Please create one</a>."
msgstr ""
#: common/lib/acm-wp-list-table.php:30 common/lib/acm-wp-list-table.php:39
+#: providers/doubleclick-for-publishers-async.php:189
#: providers/doubleclick-for-publishers.php:101
-#: providers/google-adsense.php:80
+#: providers/google-adsense.php:168
msgid "ID"
msgstr ""
#: common/lib/acm-wp-list-table.php:32 common/lib/acm-wp-list-table.php:43
-#: common/lib/acm-wp-list-table.php:232
+#: common/lib/acm-wp-list-table.php:243
+#: providers/doubleclick-for-publishers-async.php:194
#: providers/doubleclick-for-publishers.php:104
-#: providers/google-adsense.php:82
+#: providers/google-adsense.php:172
msgid "Priority"
msgstr ""
#: common/lib/acm-wp-list-table.php:33 common/lib/acm-wp-list-table.php:44
-#: common/lib/acm-wp-list-table.php:237
+#: common/lib/acm-wp-list-table.php:248
+#: providers/doubleclick-for-publishers-async.php:195
#: providers/doubleclick-for-publishers.php:105
+#: providers/google-adsense.php:173
msgid "Logical Operator"
msgstr ""
#: common/lib/acm-wp-list-table.php:34 common/lib/acm-wp-list-table.php:45
#: common/lib/acm-wp-list-table.php:198
-#: common/views/ad-code-manager.tpl.php:73
+#: common/views/ad-code-manager.tpl.php:125
+#: providers/doubleclick-for-publishers-async.php:196
#: providers/doubleclick-for-publishers.php:106
-#: providers/google-adsense.php:83
+#: providers/google-adsense.php:174
msgid "Conditionals"
msgstr ""
-#: common/lib/acm-wp-list-table.php:60 common/lib/acm-wp-list-table.php:296
+#: common/lib/acm-wp-list-table.php:60 common/lib/acm-wp-list-table.php:307
msgid "Delete"
msgstr ""
@@ -80,7 +85,7 @@ msgid "No ad codes have been configured."
msgstr ""
#: common/lib/acm-wp-list-table.php:205
-#: common/views/ad-code-manager.tpl.php:77
+#: common/views/ad-code-manager.tpl.php:129
msgid "Select conditional"
msgstr ""
@@ -92,31 +97,27 @@ msgstr ""
msgid "URL Variables"
msgstr ""
-#: common/lib/acm-wp-list-table.php:240
+#: common/lib/acm-wp-list-table.php:251
msgid "OR"
msgstr ""
-#: common/lib/acm-wp-list-table.php:241
+#: common/lib/acm-wp-list-table.php:252
msgid "AND"
msgstr ""
-#: common/lib/acm-wp-list-table.php:269
+#: common/lib/acm-wp-list-table.php:280
msgid "None"
msgstr ""
-#: common/lib/acm-wp-list-table.php:286
-msgid "Preview Ad Code"
-msgstr ""
-
-#: common/lib/acm-wp-list-table.php:287
+#: common/lib/acm-wp-list-table.php:298
msgid "Edit Ad Code"
msgstr ""
-#: common/lib/acm-wp-list-table.php:326
+#: common/lib/acm-wp-list-table.php:337
msgid "Cancel"
msgstr ""
-#: common/lib/acm-wp-list-table.php:328
+#: common/lib/acm-wp-list-table.php:339
msgid "Update"
msgstr ""
@@ -132,11 +133,49 @@ msgstr ""
msgid "Ad codes deleted."
msgstr ""
-#: common/views/ad-code-manager.tpl.php:50
-#: common/views/ad-code-manager.tpl.php:95
+#: common/views/ad-code-manager.tpl.php:20
+msgid "Options saved."
+msgstr ""
+
+#: common/views/ad-code-manager.tpl.php:57
+msgid "Configuration"
+msgstr ""
+
+#: common/views/ad-code-manager.tpl.php:61
+msgid "Select a provider:"
+msgstr ""
+
+#: common/views/ad-code-manager.tpl.php:78
+msgid "Save Options"
+msgstr ""
+
+#: common/views/ad-code-manager.tpl.php:83
+#: common/views/ad-code-manager.tpl.php:147
msgid "Add New Ad Code"
msgstr ""
+#: providers/doubleclick-for-publishers-async.php:40
+#: providers/doubleclick-for-publishers-async.php:190
+#: providers/google-adsense.php:94 providers/google-adsense.php:169
+msgid "Tag"
+msgstr ""
+
+#: providers/doubleclick-for-publishers-async.php:50
+#: providers/doubleclick-for-publishers-async.php:191
+#: providers/google-adsense.php:104 providers/google-adsense.php:170
+msgid "Tag ID"
+msgstr ""
+
+#: providers/doubleclick-for-publishers-async.php:56
+#: providers/doubleclick-for-publishers-async.php:192
+msgid "DFP ID"
+msgstr ""
+
+#: providers/doubleclick-for-publishers-async.php:62
+#: providers/doubleclick-for-publishers-async.php:193
+msgid "Tag Name"
+msgstr ""
+
#: providers/doubleclick-for-publishers.php:67
#: providers/doubleclick-for-publishers.php:102
msgid "Site Name"
@@ -150,17 +189,17 @@ msgstr ""
msgid "Zone1"
msgstr ""
-#: providers/google-adsense.php:44 providers/google-adsense.php:81
-msgid "Slot"
+#: providers/google-adsense.php:110 providers/google-adsense.php:171
+msgid "Publisher ID"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "Ad Code Manager"
msgstr ""
-#. #-#-#-#-# plugin.pot (Ad Code Manager 0.3-working) #-#-#-#-#
+#. #-#-#-#-# plugin.pot (Ad Code Manager 0.4) #-#-#-#-#
#. Plugin URI of the plugin/theme
-#. #-#-#-#-# plugin.pot (Ad Code Manager 0.3-working) #-#-#-#-#
+#. #-#-#-#-# plugin.pot (Ad Code Manager 0.4) #-#-#-#-#
#. Author URI of the plugin/theme
msgid "http://automattic.com"
msgstr ""
View
109 providers/doubleclick-for-publishers-async.php
@@ -7,25 +7,57 @@ public function __construct() {
// Default ad zones for DFP Async
$this->ad_tag_ids = array(
array(
+ 'tag' => '728x90',
+ 'url_vars' => array(
'tag' => '728x90',
- 'url_vars' => array(
- 'tag' => '728x90',
- 'sz' => '728x90',
- 'height' => '90',
- 'width' => '728',
- ),
- 'enable_ui_mapping' => true,
+ 'sz' => '728x90',
+ 'height' => '90',
+ 'width' => '728',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '300x250',
+ 'url_vars' => array(
'tag' => '300x250',
- 'url_vars' => array(
- 'tag' => '300x250',
- 'sz' => '300x250',
- 'width' => '300',
- 'height' => '250',
- ),
- 'enable_ui_mapping' => true,
+ 'sz' => '300x250',
+ 'width' => '300',
+ 'height' => '250',
+ ),
+ 'enable_ui_mapping' => true,
+ ),
+ array(
+ 'tag' => '120x600',
+ 'url_vars' => array(
+ 'tag' => '120x600',
+ 'sz' => '120x600',
+ 'width' => '120',
+ 'height' => '600',
),
+ 'enable_ui_mapping' => true,
+ ),
+ array(
+ 'tag' => '160x600',
+ 'url_vars' => array(
+ 'tag' => '160x600',
+ 'sz' => '160x600',
+ 'width' => '160',
+ 'height' => '600',
+ ),
+ 'enable_ui_mapping' => true,
+ ),
+ array(
+ 'tag' => '300x600',
+ 'url_vars' => array(
+ 'tag' => '300x600',
+ 'sz' => '300x600',
+ 'width' => '300',
+ 'height' => '600',
+ ),
+ 'enable_ui_mapping' => true,
+ ),
+
+
// An extra, special tag to make sure the <head> gets the output we need it to
array(
'tag' => 'dfp_head',
@@ -42,8 +74,8 @@ public function __construct() {
'required' => true,
'type' => 'select',
'options' => array(
- // This is added later, through 'acm_ad_code_args' filter
- ),
+ // This is added later, through 'acm_ad_code_args' filter
+ ),
),
array(
'key' => 'tag_id',
@@ -81,13 +113,13 @@ public function __construct() {
public function filter_ad_code_args( $ad_code_args ) {
global $ad_code_manager;
- foreach( $ad_code_args as $tag => $ad_code_arg ) {
+ foreach ( $ad_code_args as $tag => $ad_code_arg ) {
if ( 'tag' != $ad_code_arg['key'] )
continue;
// Get all of the tags that are registered, and provide them as options
- foreach( (array)$ad_code_manager->ad_tag_ids as $ad_tag ) {
+ foreach ( (array)$ad_code_manager->ad_tag_ids as $ad_tag ) {
if ( isset( $ad_tag['enable_ui_mapping'] ) && $ad_tag['enable_ui_mapping'] )
$ad_code_args[$tag]['options'][$ad_tag['tag']] = $ad_tag['tag'];
}
@@ -103,11 +135,11 @@ public function filter_ad_code_args( $ad_code_args ) {
public function filter_output_html( $output_html, $tag_id ) {
global $ad_code_manager;
- switch( $tag_id ) {
- case 'dfp_head':
- $ad_tags = $ad_code_manager->ad_tag_ids;
- ob_start();
-?>
+ switch ( $tag_id ) {
+ case 'dfp_head':
+ $ad_tags = $ad_code_manager->ad_tag_ids;
+ ob_start();
+?>
<!-- Include google_services.js -->
<script type='text/javascript'>
var googletag = googletag || {};
@@ -117,7 +149,7 @@ public function filter_output_html( $output_html, $tag_id ) {
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
-gads.src = (useSSL ? 'https:' : 'http:') +
+gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
@@ -126,18 +158,21 @@ public function filter_output_html( $output_html, $tag_id ) {
<script type='text/javascript'>
googletag.cmd.push(function() {
<?php
-foreach ( (array) $ad_tags as $tag ):
- if ( $tag['tag'] == 'dfp_head' )
- continue;
-
- $tt = $tag['url_vars'];
- $matching_ad_code = $ad_code_manager->get_matching_ad_code( $tag['tag'] );
- if ( ! empty( $matching_ad_code ) ) {
+ foreach ( (array) $ad_tags as $tag ):
+ if ( $tag['tag'] == 'dfp_head' )
+ continue;
+
+ $tt = $tag['url_vars'];
+ $matching_ad_code = $ad_code_manager->get_matching_ad_code( $tag['tag'] );
+ if ( ! empty( $matching_ad_code ) ) {
+ // @todo There might be a case when there are two tags registered with the same dimensions
+ // and the same tag id ( which is just a div id ). This confuses DFP Async, so we need to make sure
+ // that tags are unique
?>
googletag.defineSlot('/<?php echo esc_attr( $matching_ad_code['url_vars']['dfp_id'] ); ?>/<?php echo esc_attr( $matching_ad_code['url_vars']['tag_name'] ); ?>', [<?php echo (int)$tt['width'] ?>, <?php echo (int)$tt['height'] ?>], "acm-ad-tag-<?php echo esc_attr( $matching_ad_code['url_vars']['tag_id'] ); ?>").addService(googletag.pubads());
<?php
- }
-endforeach;
+ }
+ endforeach;
?>
googletag.pubads().enableSingleRequest();
googletag.pubads().collapseEmptyDivs();
@@ -145,9 +180,9 @@ public function filter_output_html( $output_html, $tag_id ) {
});
</script>
<?php
-
+
$output_script = ob_get_clean();
- break;
+ break;
default:
$output_script = "
<div id='acm-ad-tag-%tag_id%' style='width:%width%px; height:%height%px;'>
@@ -156,8 +191,8 @@ public function filter_output_html( $output_html, $tag_id ) {
</script>
</div>
";
- }
- return $output_script;
+ }
+ return $output_script;
}
View
106 providers/google-adsense.php
@@ -12,80 +12,80 @@ class Google_AdSense_ACM_Provider extends ACM_Provider {
*/
public function __construct() {
// Default output HTML
- $this->output_html = '<div id="acm-ad-tag-%tag%"><script type="text/javascript"><!--
-google_ad_client = "%publisher_id%";
-google_ad_slot = "%tag_id%";
-google_ad_width = %width%;
-google_ad_height = %height%;
-//-->
-</script>
+ $this->output_html = '<div id="acm-ad-tag-%tag%"><script type="text/javascript"><!--
+google_ad_client = "%publisher_id%";
+google_ad_slot = "%tag_id%";
+google_ad_width = %width%;
+google_ad_height = %height%;
+//-->
+</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>';
// Default Ad Tag Ids (you will pass this in your shortcode or template tag)
$this->ad_tag_ids = array(
array(
+ 'tag' => '728x90_leaderboard',
+ 'url_vars' => array(
'tag' => '728x90_leaderboard',
- 'url_vars' => array(
- 'tag' => '728x90_leaderboard',
- 'height' => '90',
- 'width' => '728',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '90',
+ 'width' => '728',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '468x60_banner',
+ 'url_vars' => array(
'tag' => '468x60_banner',
- 'url_vars' => array(
- 'tag' => '468x60_banner',
- 'height' => '60',
- 'width' => '468',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '60',
+ 'width' => '468',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '120x600_skyscraper',
+ 'url_vars' => array(
'tag' => '120x600_skyscraper',
- 'url_vars' => array(
- 'tag' => '120x600_skyscraper',
- 'height' => '600',
- 'width' => '120',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '600',
+ 'width' => '120',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '160x600_wideskyscraper',
+ 'url_vars' => array(
'tag' => '160x600_wideskyscraper',
- 'url_vars' => array(
- 'tag' => '160x600_wideskyscraper',
- 'height' => '600',
- 'width' => '160',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '600',
+ 'width' => '160',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '300x600_largeskyscraper',
+ 'url_vars' => array(
'tag' => '300x600_largeskyscraper',
- 'url_vars' => array(
- 'tag' => '300x600_largeskyscraper',
- 'height' => '600',
- 'width' => '300',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '600',
+ 'width' => '300',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '250x250_square',
+ 'url_vars' => array(
'tag' => '250x250_square',
- 'url_vars' => array(
- 'tag' => '250x250_square',
- 'height' => '250',
- 'width' => '250',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '250',
+ 'width' => '250',
),
+ 'enable_ui_mapping' => true,
+ ),
array(
+ 'tag' => '200x200_smallsquare',
+ 'url_vars' => array(
'tag' => '200x200_smallsquare',
- 'url_vars' => array(
- 'tag' => '200x200_smallsquare',
- 'height' => '200',
- 'width' => '200',
- ),
- 'enable_ui_mapping' => true,
+ 'height' => '200',
+ 'width' => '200',
),
+ 'enable_ui_mapping' => true,
+ ),
);
$this->ad_code_args = array(
@@ -96,8 +96,8 @@ public function __construct() {
'required' => true,
'type' => 'select',
'options' => array(
- // This is added later, through 'acm_ad_code_args' filter
- ),
+ // This is added later, through 'acm_ad_code_args' filter
+ ),
),
array(
'key' => 'tag_id',
@@ -125,13 +125,13 @@ public function __construct() {
public function filter_ad_code_args( $ad_code_args ) {
global $ad_code_manager;
- foreach( $ad_code_args as $tag => $ad_code_arg ) {
+ foreach ( $ad_code_args as $tag => $ad_code_arg ) {
if ( 'tag' != $ad_code_arg['key'] )
continue;
// Get all of the tags that are registered, and provide them as options
- foreach( (array)$ad_code_manager->ad_tag_ids as $ad_tag ) {
+ foreach ( (array)$ad_code_manager->ad_tag_ids as $ad_tag ) {
if ( isset( $ad_tag['enable_ui_mapping'] ) && $ad_tag['enable_ui_mapping'] )
$ad_code_args[$tag]['options'][$ad_tag['tag']] = $ad_tag['tag'];
}
View
12 providers/openx.php
@@ -1,12 +0,0 @@
-<?php
-/**
- * OpenX ACM Provider for Ad Code Manager
- *
- * @todo implement
- */
-class Openx_ACM_Provider extends ACM_Provider {
- function __construct() {
-
- parent::__construct();
- }
-}
View
7 readme.txt
@@ -2,8 +2,8 @@
Contributors: rinatkhaziev, jeremyfelt, danielbachhuber, carldanley, zztimur, automattic, doejo
Tags: advertising, ad codes, ads, adsense, dfp, doubleclick for publishers
Requires at least: 3.1
-Tested up to: 3.5.2
-Stable tag: 0.4
+Tested up to: 3.6-beta1
+Stable tag: 0.4.1
Manage your ad codes through the WordPress admin in a safe and easy way.
@@ -56,7 +56,8 @@ Flush the cache when adding or deleting ad codes, and set priority of 10 when a
== Changelog ==
-= 0.4.1 (??? ??, 2013) =
+= 0.4.1 (Apr. 27, 2013) =
+* Disabled rendering of ads on preview to avoid crawling errors. Thanks [Paul Gibbs](https://github.com/paulgibbs)
* Bug fix: Corrected "medium rectangle" ad size for DFP Async Provider. Thanks [Marco](https://github.com/NRG-R9T)
= 0.4 (Mar. 19, 2013) =
2  tests
@@ -1 +1 @@
-Subproject commit d90cc340c7337961e38b083282d45ab4c429cb2d
+Subproject commit 8b3865836af127949ebce9d51d8efb2b52e2a32f
Please sign in to comment.
Something went wrong with that request. Please try again.