Changeset 1364383
- Timestamp:
- 03/04/2016 11:50:17 PM (10 years ago)
- Location:
- pagefrog/trunk
- Files:
-
- 1 added
- 16 edited
-
README.txt (modified) (1 diff)
-
admin/class-pagefrog-admin.php (modified) (6 diffs)
-
admin/class-pagefrog-analytics-storage.php (modified) (1 diff)
-
admin/class-pagefrog-new-post-settings-storage.php (modified) (3 diffs)
-
admin/js/pagefrog-previews.js (modified) (1 diff)
-
admin/js/pagefrog-settings.js (modified) (1 diff)
-
admin/pagefrog-post-metadata.php (modified) (10 diffs)
-
admin/pagefrog-preview.php (modified) (1 diff)
-
admin/pagefrog-settings.php (modified) (7 diffs)
-
admin/pagefrog-setup.php (modified) (1 diff)
-
admin/partials/pagefrog-amp-template-meta-author.php (modified) (1 diff)
-
admin/partials/pagefrog-amp-template-single.php (modified) (3 diffs)
-
admin/partials/pagefrog-amp-template-styles.php (modified) (2 diffs)
-
includes/class-pagefrog.php (modified) (3 diffs)
-
pagefrog.php (modified) (1 diff)
-
public/class-amp-header-image-sanitizer.php (added)
-
templates/pagefrog-feed.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pagefrog/trunk/README.txt
r1361838 r1364383 224 224 225 225 == Changelog == 226 = 1.0.8 = 227 *Release Date - March 5, 2016* 228 229 * Solve header image duplication 230 * Enable posts by default, rather than forcing people to do it themselves 231 226 232 = 1.0.7.2 = 227 233 *Release Date - February 29, 2016* -
pagefrog/trunk/admin/class-pagefrog-admin.php
r1361838 r1364383 132 132 } 133 133 if ($hook === 'edit.php') { 134 wp_enqueue_style( 'jquery_ui' );134 wp_enqueue_style( 'jquery_ui' ); 135 135 wp_enqueue_style( 'thickbox' ); 136 136 wp_enqueue_style( 'admin_css' ); … … 424 424 425 425 /** 426 * Add the sanitizer toamp ads.426 * Add the sanitizer for amp ads. 427 427 * 428 428 * @since 1.0.6 … … 433 433 $sanitizer_classes['PageFrog_Amp_Ad_Injection_Sanitizer'] = array( 434 434 'ads' => $ads 435 ); 436 return $sanitizer_classes; 437 } 438 439 /** 440 * Add the sanitizer for header images. 441 * 442 * @since 1.0.8 443 */ 444 public function add_amp_header_image_sanitizer( $sanitizer_classes, $post ) { 445 require_once( dirname( dirname( __FILE__ ) ) . '/public/class-amp-header-image-sanitizer.php' ); 446 $new_posts = new PageFrog_NewPostSettings_Storage(); 447 $sanitizer_classes['PageFrog_Amp_Header_Image_Sanitizer'] = array( 448 'new_posts' => $new_posts, 449 'post' => $post 435 450 ); 436 451 return $sanitizer_classes; … … 769 784 } 770 785 $post_title = get_the_title( $post ); 771 echo "<span title='View PageFrog Format Settings' class='pagefrog-status-circle pagefrog-show-preview' data-post-id='$post' data-post-title='$post_title'><span class='pagefrog-status-circle-inner $fill $color'></span></span>";786 echo "<span pagefrog-title='View PageFrog Format Settings' class='pagefrog-status-circle pagefrog-show-preview' data-post-id='$post' data-post-title='$post_title'><span class='pagefrog-status-circle-inner $fill $color'></span></span>"; 772 787 } 773 788 } … … 925 940 926 941 // we only need this temporarily, until AMP WP 0.4 927 add_rewrite_endpoint( AMP_QUERY_VAR, EP_ PERMALINK | EP_PAGES);942 add_rewrite_endpoint( AMP_QUERY_VAR, EP_ALL ); 928 943 // end temp need 929 944 … … 1177 1192 } 1178 1193 1179 public function set_new_post_metadata( $post_id, $post, $update ) { 1180 if ( ! $update ) { 1194 public function set_new_post_metadata( $post_id ) { 1195 $post = get_post( $post_id ); 1196 if ( $post->post_modified_gmt == $post->post_date_gmt && $post->post_type !== 'revision' ) { 1181 1197 $new_post = new PageFrog_NewPostSettings_Storage(); 1182 1198 $status = new PageFrog_PostStatus( $post_id ); -
pagefrog/trunk/admin/class-pagefrog-analytics-storage.php
r1349446 r1364383 257 257 if ( isset( $data['other_amp_analytics_code'] ) && PageFrog_Utils::string_isnt_empty( $data['other_amp_analytics_code'] ) ) { 258 258 if ( 259 PageFrog_Utils::starts_with( trim( $data['other_amp_analytics_code'] ), "<amp-analytics >" ) &&259 PageFrog_Utils::starts_with( trim( $data['other_amp_analytics_code'] ), "<amp-analytics" ) && 260 260 PageFrog_Utils::ends_with( trim( $data['other_amp_analytics_code'] ), "</amp-analytics>" ) 261 261 ) { -
pagefrog/trunk/admin/class-pagefrog-new-post-settings-storage.php
r1361838 r1364383 120 120 public function get_fbia_disable_other_plugins_string() { 121 121 return $this->get_fbia_disable_other_plugins_bool() ? 'true' : 'false'; 122 } 123 124 public function get_amp_show_header_images_bool() { 125 return $this->settings['amp_show_header_images'] ? true : false; 126 } 127 128 public function get_amp_show_header_images_string() { 129 return $this->get_amp_show_header_images_bool() ? 'true' : 'false'; 130 } 131 132 public function get_fbia_show_header_images_bool() { 133 return $this->settings['fbia_show_header_images'] ? true : false; 134 } 135 136 public function get_fbia_show_header_images_string() { 137 return $this->get_fbia_show_header_images_bool() ? 'true' : 'false'; 122 138 } 123 139 … … 171 187 } 172 188 189 if ( isset( $data['amp_show_header_images'] ) && PageFrog_Utils::string_isnt_empty( $data['amp_show_header_images'] ) ) { 190 if ( $data['amp_show_header_images'] === 'true' || $data['amp_show_header_images'] === true ) { 191 $clean_data['amp_show_header_images'] = 1; 192 } else { 193 $clean_data['amp_show_header_images'] = 0; 194 } 195 } 196 197 if ( isset( $data['fbia_show_header_images'] ) && PageFrog_Utils::string_isnt_empty( $data['fbia_show_header_images'] ) ) { 198 if ( $data['fbia_show_header_images'] === 'true' || $data['fbia_show_header_images'] === true ) { 199 $clean_data['fbia_show_header_images'] = 1; 200 } else { 201 $clean_data['fbia_show_header_images'] = 0; 202 } 203 } 204 173 205 return $clean_data; 174 206 } … … 195 227 'fbia_enable_new_post' => 1, 196 228 'amp_disable_other_plugins' => 0, 197 'fbia_disable_other_plugins' => 0 229 'fbia_disable_other_plugins' => 0, 230 'amp_show_header_images' => 1, 231 'fbia_show_header_images' => 1 198 232 ); 199 233 ?> -
pagefrog/trunk/admin/js/pagefrog-previews.js
r1349446 r1364383 123 123 124 124 // show tooltips 125 jQuery( document ).tooltip(); 126 125 jQuery(document).tooltip({ 126 items: "[pagefrog-title]", 127 content: function () { 128 return jQuery(this).attr('pagefrog-title'); 129 } 130 }); 127 131 128 132 // mobile preview links -
pagefrog/trunk/admin/js/pagefrog-settings.js
r1359856 r1364383 20 20 old_html = jQuery(this).html(); 21 21 jQuery(this).html("<img style='float:left;position:relative;top:2px;width:22px' src='" + jQuery(this).attr('data-loading-icon') + "'><span> " + text + "</span>"); 22 var checkboxes = jQuery('.published-posts-checkbox[data-platform=' + jQuery(this).attr('data-platform') );22 var checkboxes = jQuery('.published-posts-checkbox[data-platform=' + jQuery(this).attr('data-platform') + "]"); 23 23 for (var i = 0; i < checkboxes.length; i++) { 24 24 if (checkboxes[i].checked) { -
pagefrog/trunk/admin/pagefrog-post-metadata.php
r1359856 r1364383 101 101 public function get_fbia_status() { 102 102 $stored_status = get_post_meta( $this->post_id, self::FBIA_STATUS_KEY, true); 103 if ($stored_status === null) { 103 if ( $stored_status === null || $stored_status === '' ) { 104 $stored_status = true; 105 } else if ( $stored_status === '1' || $stored_status === 1 ) { 106 $stored_status = true; 107 } else if ( $stored_status === '0' || $stored_status === 0) { 104 108 $stored_status = false; 105 } else if ($stored_status == '1' || $stored_status == 1) {106 $stored_status = true;107 109 } 108 110 return $stored_status; … … 116 118 public function get_amp_status() { 117 119 $stored_status = get_post_meta( $this->post_id, self::AMP_STATUS_KEY, true); 118 if ($stored_status === null) { 120 if ( $stored_status === null || $stored_status === '' ) { 121 $stored_status = true; 122 } else if ( $stored_status === '1' || $stored_status === 1 ) { 123 $stored_status = true; 124 } else if ( $stored_status === '0' || $stored_status === 0 ) { 119 125 $stored_status = false; 120 } else if ($stored_status == '1' || $stored_status == 1) {121 $stored_status = true;122 126 } 123 127 return $stored_status; … … 140 144 } 141 145 142 add_post_meta( $this->post_id, self::FBIA_STATUS_KEY, $status, true ) or 143 update_post_meta( $this->post_id, self::FBIA_STATUS_KEY, $status ); 146 $to_write = $status ? 1 : 0; 147 148 add_post_meta( $this->post_id, self::FBIA_STATUS_KEY, $to_write, true ) or 149 update_post_meta( $this->post_id, self::FBIA_STATUS_KEY, $to_write ); 144 150 return true; 145 151 } … … 161 167 } 162 168 163 $enabled = $status && wp_amp_plugin_is_installed() && wp_amp_plugin_is_active(); 164 add_post_meta( $this->post_id, self::AMP_STATUS_KEY, $status, true ) or 165 update_post_meta( $this->post_id, self::AMP_STATUS_KEY, $status ); 169 $to_write = $status && wp_amp_plugin_is_installed() && wp_amp_plugin_is_active() ? 1 : 0; 170 171 add_post_meta( $this->post_id, self::AMP_STATUS_KEY, $to_write, true ) or 172 update_post_meta( $this->post_id, self::AMP_STATUS_KEY, $to_write ); 166 173 return true; 167 174 } … … 201 208 */ 202 209 public static function get_amp_enabled_post_count( $post_type ) { 210 $meta_query = array( 211 'relation' => 'OR', 212 array( 213 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 214 'value' => 1, 215 ), 216 array( 217 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 218 'compare' => 'NOT EXISTS', 219 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 220 ), 221 array( 222 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 223 'value' => '', 224 ) 225 ); 203 226 $args = array( 204 'meta_key' => PageFrog_PostStatus::AMP_STATUS_KEY, 205 'meta_value' => 1, 227 'meta_query' => $meta_query, 206 228 'post_status' => 'publish' 207 229 ); … … 220 242 */ 221 243 public static function get_fbia_enabled_post_count( $post_type ) { 244 $meta_query = array( 245 'relation' => 'OR', 246 array( 247 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 248 'value' => 1, 249 ), 250 array( 251 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 252 'compare' => 'NOT EXISTS', 253 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 254 ), 255 array( 256 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 257 'value' => '', 258 ) 259 ); 222 260 $args = array( 223 'meta_key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 224 'meta_value' => 1, 261 'meta_query' => $meta_query, 225 262 'post_status' => 'publish' 226 263 ); … … 240 277 public static function amp_set_all_published_posts( $enabled, $post_type ) { 241 278 $meta_query = array( 242 array( 243 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 244 'value' => 1, 245 'compare' => '=' 279 'relation' => 'OR', 280 array( 281 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 282 'value' => 1 283 ), 284 array( 285 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 286 'compare' => 'NOT EXISTS', 287 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 288 ), 289 array( 290 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 291 'value' => '', 246 292 ) 247 293 ); … … 250 296 // we are actually enabling the posts, so we need to select all the disabled ones to change 251 297 $meta_query = array( 252 'relation' => 'OR',253 298 array( 254 299 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 255 'value' => false, 256 ), 257 array( 258 'key' => PageFrog_PostStatus::AMP_STATUS_KEY, 259 'compare' => 'NOT EXISTS', 260 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 300 'value' => 0, 261 301 ) 262 302 ); … … 287 327 public static function fbia_set_all_published_posts( $enabled, $post_type ) { 288 328 $meta_query = array( 289 array( 290 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 291 'value' => 1, 292 'compare' => '=' 329 'relation' => 'OR', 330 array( 331 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 332 'value' => 1 333 ), 334 array( 335 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 336 'compare' => 'NOT EXISTS', 337 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 338 ), 339 array( 340 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 341 'value' => '', 293 342 ) 294 343 ); … … 299 348 array( 300 349 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 301 'value' => false 302 ), 303 array( 304 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 305 'compare' => 'NOT EXISTS', 306 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 307 ), 350 'value' => 0 351 ) 308 352 ); 309 353 } -
pagefrog/trunk/admin/pagefrog-preview.php
r1359856 r1364383 26 26 <div class="col-xs-6 col-sm-7"> 27 27 <label for="pagefrog-fbia-status" style="font-size:12px"> 28 <input type="checkbox" id="pagefrog-fbia-status" class="pagefrog-status-toggle" <?php echo $fbia_status_string; ?> name="fbia_status" > Instant Articles <span class="dashicons dashicons-editor-help" title="When enabled, this post will be served in Instant Articles format for mobile visitors from the Facebook app. Access to Facebook Instant Articles is required." style="line-height:0.5;font-size:15px"></span>28 <input type="checkbox" id="pagefrog-fbia-status" class="pagefrog-status-toggle" <?php echo $fbia_status_string; ?> name="fbia_status" > Instant Articles <span class="dashicons dashicons-editor-help" pagefrog-title="When enabled, this post will be served in Instant Articles format for mobile visitors from the Facebook app. Access to Facebook Instant Articles is required." style="line-height:0.5;font-size:15px"></span> 29 29 </label> 30 30 </div> 31 31 <div class="col-sm-5"> 32 32 <label for="pagefrog-amp-status" style="font-size:12px" class="<?php echo $amp_enabled_string ?>"> 33 <input type="checkbox" id="pagefrog-amp-status" class="pagefrog-status-toggle" <?php echo $amp_status_string . ' ' . $amp_enabled_string; ?> name="amp_status" > AMP HTML <span class="dashicons dashicons-editor-help" title="When enabled, this post will be served in AMP HTML format for mobile visitors from Google, Twitter, LinkedIn, and Pinterest apps upon the official release of AMP." style="line-height:0.5;font-size:15px"></span>33 <input type="checkbox" id="pagefrog-amp-status" class="pagefrog-status-toggle" <?php echo $amp_status_string . ' ' . $amp_enabled_string; ?> name="amp_status" > AMP HTML <span class="dashicons dashicons-editor-help" pagefrog-title="When enabled, this post will be served in AMP HTML format for mobile visitors from Google, Twitter, LinkedIn, and Pinterest apps upon the official release of AMP." style="line-height:0.5;font-size:15px"></span> 34 34 </label> 35 35 </div> -
pagefrog/trunk/admin/pagefrog-settings.php
r1361838 r1364383 36 36 '', 37 37 'render_fbia_disable_other_plugins', 38 $GLOBALS['PAGEFROG_SETTINGS_PAGE_SLUG'], 39 PageFrog_NewPostSettings_Storage::OPTIONS_KEY, 40 array( 'new_post' => $new_post ) 41 ); 42 43 add_settings_field( 44 'amp_show_header_images', 45 '', 46 'render_amp_show_header_images', 47 $GLOBALS['PAGEFROG_SETTINGS_PAGE_SLUG'], 48 PageFrog_NewPostSettings_Storage::OPTIONS_KEY, 49 array( 'new_post' => $new_post ) 50 ); 51 52 add_settings_field( 53 'fbia_show_header_images', 54 '', 55 'render_fbia_show_header_images', 38 56 $GLOBALS['PAGEFROG_SETTINGS_PAGE_SLUG'], 39 57 PageFrog_NewPostSettings_Storage::OPTIONS_KEY, … … 81 99 ?><input type="hidden" name="<?php echo PageFrog_NewPostSettings_Storage::OPTIONS_KEY; ?>[fbia_disable_other_plugins]" value="<?php echo $args['new_post']->get_fbia_disable_other_plugins_string(); ?>"><?php 82 100 } 101 function render_amp_show_header_images( $args ) { 102 ?><input type="hidden" name="<?php echo PageFrog_NewPostSettings_Storage::OPTIONS_KEY; ?>[amp_show_header_images]" value="<?php echo $args['new_post']->get_amp_show_header_images_string(); ?>"><?php 103 } 104 function render_fbia_show_header_images( $args ) { 105 ?><input type="hidden" name="<?php echo PageFrog_NewPostSettings_Storage::OPTIONS_KEY; ?>[fbia_show_header_images]" value="<?php echo $args['new_post']->get_fbia_show_header_images_string(); ?>"><?php 106 } 83 107 84 108 … … 119 143 <p class="required">To enable Instant Articles on published posts on your site, select the post types that you'd like to be converted then click "Enable FBIA".</p> 120 144 </div> 121 <div class="col-sm-9 ">145 <div class="col-sm-9 col-lg-7"> 122 146 <div class="row"> 123 <div class="col-sm-12 ">147 <div class="col-sm-12 big-margin-bottom"> 124 148 <div class="well"> 125 149 <div class="row"> … … 143 167 </div> 144 168 <?php endforeach; ?> 145 </div> 146 </div> 147 </div> 148 <div class="row"> 149 <div class="col-sm-12 margin-top-bottom big-margin-bottom"> 150 <div class="row"> 151 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="1" data-platform="fbia" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Enable FBIA</a></div> 152 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="0" data-platform="fbia" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Disable FBIA</a></div> 169 <div class="row"> 170 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="1" data-platform="fbia" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Enable FBIA</a></div> 171 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="0" data-platform="fbia" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Disable FBIA</a></div> 172 </div> 153 173 </div> 154 174 </div> … … 217 237 <div class="col-sm-9"> 218 238 <div class="row"> 219 <div class="col-sm-12 ">239 <div class="col-sm-12 big-margin-bottom"> 220 240 <div class="well"> 221 241 <div class="row"> … … 239 259 </div> 240 260 <?php endforeach; ?> 241 </div> 242 </div> 243 </div> 244 <div class="row"> 245 <div class="col-sm-12 margin-top-bottom big-margin-bottom"> 246 <div class="row"> 261 <div class="row"> 247 262 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="1" data-platform="amp" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Enable AMP</a></div> 248 263 <div class="col-sm-6"><a href="#" class="button block bulk-enable-button" data-enable="0" data-platform="amp" data-loading-icon="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>">Disable AMP</a></div> 264 </div> 249 265 </div> 250 266 </div> … … 310 326 </div> 311 327 </div> 328 <div class="row"> 329 <div class="col-sm-12 margin-top-bottom"> 330 <label for="amp-show-header-images"> 331 <input id="amp-show-header-images" type="checkbox" class="sync-form" name="<?php echo PageFrog_NewPostSettings_Storage::OPTIONS_KEY; ?>[amp_show_header_images]" <?php if ( $new_post->get_amp_show_header_images_bool() ) echo 'checked="checked"' ?>> Display Featured Image 332 </label> 333 </div> 334 </div> 312 335 </div> 313 336 </div> -
pagefrog/trunk/admin/pagefrog-setup.php
r1355936 r1364383 58 58 } else if ( ! wp_amp_plugin_is_active() ) { ?> 59 59 <h1 class="text-center"><a href="#" data-href="<?php echo get_activate_wp_amp_plugin_url() ?>" class="button green button-lg" id="activate-amp-button">Activate AMP Plugin</a></h1> 60 <h1 class="text-center margin-top-bottom hidden" id="pagefrog-amp-ready" style="margin-top:20px;line-height:1;">< strong>READY <span class="circled green">✓</span></strong></h1>60 <h1 class="text-center margin-top-bottom hidden" id="pagefrog-amp-ready" style="margin-top:20px;line-height:1;"><button class="button greenoutline button-lg" disabled><strong> Ready <span class="green">✓ </span></strong></button></h1> 61 61 <?php 62 62 } else { ?> -
pagefrog/trunk/admin/partials/pagefrog-amp-template-meta-author.php
r1355936 r1364383 8 8 <?php endif; ?> 9 9 --> 10 <span class="author"> BY <?php echo esc_html( $post_author->display_name ); ?></span>10 <span class="author"><?php echo esc_html( $post_author->display_name ); ?></span> 11 11 </li> 12 12 <br/> -
pagefrog/trunk/admin/partials/pagefrog-amp-template-single.php
r1357722 r1364383 17 17 18 18 <?php 19 if ( has_post_thumbnail( $this->get( 'post' )->ID ) ) : 19 $possible_imgs = PageFrog_Amp_Header_Image_Sanitizer::get_header_img_srcs_possible( $this->get( 'post' )->ID ); 20 $header_img_in_content = false; 21 foreach ( $possible_imgs as $img ) { 22 if ( PageFrog_Utils::contains( $this->get( 'post_amp_content' ), $img ) ) { 23 $header_img_in_content = true; 24 break; 25 } 26 } 27 $new_post = new PageFrog_NewPostSettings_Storage(); 28 29 $show_header_img = ! $header_img_in_content && $new_post->get_amp_show_header_images_bool() && has_post_thumbnail( $this->get( 'post' )->ID ); 30 if ( $show_header_img ) : 20 31 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $this->get( 'post' )->ID ), 'full' ); 21 32 $thumb_url = $thumb[0]; … … 37 48 $width = $this->get( 'site_icon_width' ); 38 49 if ( ! $width ) { 39 $width = 32;50 $width = 24; 40 51 } 41 52 $height = $this->get( 'site_icon_height' ); 42 53 if ( ! $height ) { 43 $height = 32;54 $height = 24; 44 55 } 45 56 ?> … … 56 67 </nav> 57 68 <div class="content"> 58 <h1 class="title"><?php echo esc_html( $this->get( 'post_title' )); ?></h1>69 <h1 class="title"><?php echo $this->get( 'post_title' ); ?></h1> 59 70 <ul class="meta"> 60 71 <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author', 'meta-time', 'meta-taxonomy' ) ) ); ?> -
pagefrog/trunk/admin/partials/pagefrog-amp-template-styles.php
r1355936 r1364383 4 4 amp-img.alignleft { float: left; margin: 0 1em 1em 0; } 5 5 amp-img.aligncenter { display: block; margin-left: auto; margin-right: auto; } 6 .content amp-img { max-width: 100%; } 6 7 .alignright { float: right; } 7 8 .alignleft { float: left; } … … 142 143 blockquote { 143 144 padding: 16px; 145 padding-top: 0px; 146 padding-bottom: 0px; 144 147 margin: 8px 0 24px 0; 145 148 border-left: 2px solid <?php echo $styles->get_quotes_font_color(); ?>; -
pagefrog/trunk/includes/class-pagefrog.php
r1361838 r1364383 70 70 71 71 $this->plugin_name = 'pagefrog'; 72 $this->version = '1.0. 7.2';72 $this->version = '1.0.8'; 73 73 74 74 $this->load_dependencies(); … … 203 203 $this->loader->add_action( 'amp_post_template_body_begin', $plugin_admin, 'add_analytics_to_amp' ); 204 204 $this->loader->add_filter( 'amp_content_sanitizers', $plugin_admin, 'add_amp_ads_sanitizer', 10, 2 ); 205 $this->loader->add_filter( 'amp_content_sanitizers', $plugin_admin, 'add_amp_header_image_sanitizer', 10, 2 ); 205 206 $this->loader->add_filter( 'amp_post_template_metadata', $plugin_admin, 'add_logo_to_schema_org', 10, 2 ); 206 207 … … 217 218 218 219 // adding meta data to new posts 219 $this->loader->add_action( ' wp_insert_post', $plugin_admin, 'set_new_post_metadata', 10, 3 );220 $this->loader->add_action( 'save_post', $plugin_admin, 'set_new_post_metadata', 10, 3 ); 220 221 } 221 222 -
pagefrog/trunk/pagefrog.php
r1361838 r1364383 16 16 * Plugin URI: http://pagefrog.com/ 17 17 * Description: The PageFrog plugin allows you to easily publish and manage your content directly from WordPress for Facebook Instant Articles (FBIA) and Google Accelerated Mobile Pages (AMP) with full support for ads and analytics. 18 * Version: 1.0. 7.218 * Version: 1.0.8 19 19 * Author: PageFrog Team 20 20 * Author URI: http://pagefrog.com/ -
pagefrog/trunk/templates/pagefrog-feed.php
r1355936 r1364383 25 25 26 26 <channel> 27 <title><?php bloginfo_rss('name'); wp_title_rss();?></title>27 <title><?php bloginfo_rss('name'); ?></title> 28 28 <link><?php bloginfo_rss('url') ?></link> 29 29 <description><?php bloginfo_rss("description") ?></description> … … 32 32 33 33 <?php 34 // fetch all published posts (render up to 50 valid posts) 35 $query = new WP_Query( array( 36 'post_status' => 'publish', 37 'nopaging' => true 38 ) ); 34 // fetch all published posts marked for FBIA publishing (render up to 50 valid posts) 35 $meta_query = array( 36 'relation' => 'OR', 37 array( 38 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 39 'value' => 1, 40 ), 41 array( 42 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 43 'compare' => 'NOT EXISTS', 44 'value' => '' // to fix a wp bug: https://core.trac.wordpress.org/ticket/23268 45 ), 46 array( 47 'key' => PageFrog_PostStatus::FBIA_STATUS_KEY, 48 'value' => '', 49 ) 50 ); 51 $args = array( 52 'meta_query' => $meta_query, 53 'post_status' => 'publish' 54 ); 55 $query = new WP_Query( $args ); 39 56 $rendered_posts = 0; 40 57 … … 43 60 $query->the_post(); 44 61 45 // don't show unless marked to publish in feed 46 $post_status = new PageFrog_PostStatus( get_the_ID() ); 47 if ( $post_status->get_fbia_status() == false ) { 48 continue; 49 } 50 62 // only show up to 50 rendered posts 51 63 $rendered_posts += 1; 52 53 // only show up to 50 rendered posts54 64 if ( $rendered_posts > 50 ) { 55 65 break;
Note: See TracChangeset
for help on using the changeset viewer.