Plugin Directory

Changeset 1359856


Ignore:
Timestamp:
02/27/2016 10:19:25 PM (10 years ago)
Author:
pagefrog
Message:

mostly little fixes

Location:
pagefrog/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • pagefrog/trunk/README.txt

    r1357722 r1359856  
    224224
    225225== Changelog ==
     226= 1.0.7.1 =
     227*Release Date - February 27, 2017*
     228
     229* Explanation text to help enabling articles
     230* bug fixes
     231
    226232= 1.0.7 =
    227233*Release Date - February 24, 2016*
  • pagefrog/trunk/admin/class-amp-ads-injection-sanitizer.php

    r1355936 r1359856  
    3131                // count the number of ads we injected
    3232                $ads_injected++;
     33
     34                if ( $ads_injected === 3 ) {
     35                    break;
     36                }
    3337            }
    3438
  • pagefrog/trunk/admin/class-pagefrog-admin.php

    r1357722 r1359856  
    10751075    }
    10761076
     1077    public function add_logo_to_schema_org ( $meta_data, $post ) {
     1078        $styles = new PageFrog_Styling_Storage();
     1079        $meta_data['publisher']['logo'] = array(
     1080        '@type' => 'ImageObject',
     1081        'url' => $styles->get_logo_img_url(),
     1082        'height' => (string)$styles->get_logo_img_height(),
     1083        'width' => (string)$styles->get_logo_img_width(),
     1084    );
     1085
     1086        // Google's validator seems to expect heights and widths as strings
     1087    if ( isset( $meta_data['image'] ) && isset( $meta_data['image']['width'] ) ) {
     1088        $meta_data['image']['width'] = (string)$meta_data['image']['width'];
     1089    }
     1090    if ( isset( $meta_data['image'] ) && isset( $meta_data['image']['height'] ) ) {
     1091        $meta_data['image']['height'] = (string)$meta_data['image']['height'];
     1092    }
     1093    return $meta_data;
     1094    }
     1095
    10771096    public function edit_amp_post_template_data( $data ) {
    10781097        // change the logo
  • pagefrog/trunk/admin/integrations/google-adsense.php

    r1357722 r1359856  
    247247            return array(
    248248                'status' => 'error',
    249                 'message' => 'No valid ad units for AMP could be found in your account. Please create an Ad Unit that is in one of the following formats: 320 x 100, 336 x 280, or responsive. After creating your ad unit, please try again.'
     249                'message' => 'No valid ad units for AMP could be found in your account. Please create an Ad Unit that works well on mobile (less than 500px wide and less tall than wide, or Responsive). After creating your ad unit, please try again.'
    250250            );
    251251        }
  • pagefrog/trunk/admin/js/pagefrog-settings.js

    r1357722 r1359856  
    8989                }
    9090            },
    91             error: function () {
    92                 alert("Something went wrong! Please contact team@pagefrog.com to let us know!");
     91            error: function (xhr, error) {
     92                console.log(xhr.statusCode());
     93                alert("Something went wrong! Please contact team@pagefrog.com to let us know! Also please include the following information:\n\nHTTP Status Code: " + JSON.stringify(xhr.statusCode()));
    9394            }
    9495        });
  • pagefrog/trunk/admin/pagefrog-post-metadata.php

    r1357722 r1359856  
    253253                array(
    254254                    'key' => PageFrog_PostStatus::AMP_STATUS_KEY,
    255                     'value' => array( 0, '0', '', null ),
    256                     'compare' => 'IN'
     255                    'value' => false,
    257256                ),
    258257                array(
     
    300299                array(
    301300                    'key' => PageFrog_PostStatus::FBIA_STATUS_KEY,
    302                     'value' => array( 0, '0', '', null ),
    303                     'compare' => 'IN'
     301                    'value' => false
    304302                ),
    305303                array(
  • pagefrog/trunk/admin/pagefrog-preview.php

    r1342963 r1359856  
    7070            </div>
    7171        </div>
    72 
    73         <!-- hidding unsupported style tag
    74         <div class="row">
    75             <div class="col-sm-12 margin-top">
    76                 <div class="accordion">
    77                     <a href="#" id="pagefrog-unsupported-button" class="button block"><strong>Unsupported Styles:</strong><span class="pull-right arrow-toggle">&#x25BC;</span></a>
    78                 </div>
    79             </div>
    80         </div>
    81         <div class="row">
    82             <div class="col-sm-12">
    83                 <div class="pagefrog-rules-explanation">
    84                     <div class="pagefrog-fbia-rules hidden pagefrog-rules">
    85                         <div class="row">
    86                             <div class="col-sm-12">
    87                                 <div class="with-border">
    88                                     <p><small>The following features are not supported by Instant Articles:</small></p>
    89                                     <ul>
    90                                         <li><small>Underlined, colored, or styled spans</small></li>
    91                                         <li><small>Nested lists</small></li>
    92                                         <li><small>Tables</small></li>
    93                                     </ul>
    94                                     <p><small>PageFrog has made your article compliant by removing any unsupported features you might have used.</small></p>
    95                                 </div>
    96                             </div>
    97                         </div>
    98                     </div>
    99                     <div class="pagefrog-amp-rules hidden pagefrog-rules">
    100                         <div class="row">
    101                             <div class="col-sm-12">
    102                                 <div class="with-border">
    103                                     <p><small>Note that the following features are not supported by AMP:</small></p>
    104                                     <ul>
    105                                         <li><small>Javascript</small></li>
    106                                     </ul>
    107                                     <p><small>PageFrog has made your article compliant by removing any unsupported features you might have used.</small></p>
    108                                
    109                                 </div>
    110                             </div>
    111                         </div>
    112                         <div>&nbsp;</div>
    113                     </div>
    114                 </div>
    115             </div>
    116         </div>
    117         <div class="row">
    118             <div class="col-sm-12 margin-top-bottom"></div>
    119         </div>-->
    12072    <?php
    12173  }
  • pagefrog/trunk/admin/pagefrog-settings.php

    r1357722 r1359856  
    9494                                        <div class="col-sm-3">
    9595                                            <p><strong>Setting for published posts:</strong></p>
    96                                         </div>
    97                                         <div class="col-sm-9">
    98                                             <div class="row">
    99                                                 <div class="col-sm-12">
    100                                                     <div class="row">
    101                                                         <div class="col-sm-12 margin-top-bottom">
    102                                                             <label for="fbia-select-all" style="margin-left:19px;">
    103                                                                 <input type="checkbox" id="fbia-select-all" class="select-all" data-platform="fbia">&nbsp;Select All
    104                                                             </label>
    105                                                         </div>
    106                                                     </div>
    107                                                     <div class="well">
     96                                            <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>
     97                                        </div>
     98                                        <div class="col-sm-9">
     99                                            <div class="row">
     100                                                <div class="col-sm-12">
     101                                                    <div class="well">
     102                                                        <div class="row">
     103                                                            <div class="col-sm-12 margin-top-bottom">
     104                                                                <label for="fbia-select-all">
     105                                                                    <input type="checkbox" id="fbia-select-all" class="select-all" data-platform="fbia">&nbsp;Select All
     106                                                                </label>
     107                                                            </div>
     108                                                        </div>
     109                                                        <hr>
    108110                                                        <?php foreach ( $post_types as $label => $post_type ) : ?>
    109111                                                        <div class="row">
     
    122124                                            </div>
    123125                                            <div class="row">
    124                                                 <div class="col-sm-12 margin-top-bottom">
     126                                                <div class="col-sm-12 margin-top-bottom big-margin-bottom">
    125127                                                    <div class="row">
    126128                                                        <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>
     
    138140                                        <div class="col-sm-3">
    139141                                            <p><strong>Default setting for new posts:</strong></p>
     142                                            <p class="required">To enable Instant Articles for new posts, select which post types should be enabled, then click "Save All Settings" at the bottom of this page.</p>
    140143                                        </div>
    141144                                        <div class="col-sm-9">
     
    187190                                        <div class="col-sm-3">
    188191                                            <p><strong>Setting for published posts:</strong></p>
    189                                         </div>
    190                                         <div class="col-sm-9">
    191                                             <div class="row">
    192                                                 <div class="col-sm-12">
    193                                                     <div class="row">
    194                                                         <div class="col-sm-12 margin-top-bottom">
    195                                                             <label for="amp-select-all" style="margin-left:19px;">
    196                                                                 <input type="checkbox" id="amp-select-all" class="select-all" data-platform="amp">&nbsp;Select All
    197                                                             </label>
    198                                                         </div>
    199                                                     </div>
    200                                                     <div class="well">
     192                                            <p class="required">To enable AMP Pages on published posts on your site, select the post types that you'd like to be converted then click "Enable AMP".</p>
     193                                        </div>
     194                                        <div class="col-sm-9">
     195                                            <div class="row">
     196                                                <div class="col-sm-12">
     197                                                    <div class="well">
     198                                                        <div class="row">
     199                                                            <div class="col-sm-12 margin-top-bottom">
     200                                                                <label for="amp-select-all">
     201                                                                    <input type="checkbox" id="amp-select-all" class="select-all" data-platform="amp">&nbsp;Select All
     202                                                                </label>
     203                                                            </div>
     204                                                        </div>
     205                                                        <hr>
    201206                                                        <?php foreach ( $post_types as $label => $post_type ) : ?>
    202207                                                        <div class="row">
     
    215220                                            </div>
    216221                                            <div class="row">
    217                                                 <div class="col-sm-12 margin-top-bottom">
     222                                                <div class="col-sm-12 margin-top-bottom big-margin-bottom">
    218223                                                    <div class="row">
    219224                                                        <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>
     
    231236                                        <div class="col-sm-3">
    232237                                            <p><strong>Default setting for new posts:</strong></p>
     238                                            <p class="required">To enable AMP Pages for new posts, select which post types should be enabled, then click "Save All Settings" at the bottom of this page.</p>
    233239                                        </div>
    234240                                        <div class="col-sm-9">
  • pagefrog/trunk/admin/pagefrog-styling.php

    r1357722 r1359856  
    373373
    374374    function render_styling_page () {
    375         $recent_posts = wp_get_recent_posts(array(), OBJECT_K);
     375        $post_types = PageFrog_NewPostSettings_Storage::get_post_types();
     376        $valid_post_types = array();
     377        foreach ( $post_types as $label => $post_type ) {
     378            $valid_post_types[] = $label;
     379        }
     380        $recent_posts = wp_get_recent_posts(array(
     381            'post_type' => $valid_post_types
     382        ), OBJECT_K);
    376383
    377384
  • pagefrog/trunk/includes/class-pagefrog.php

    r1357722 r1359856  
    7070
    7171        $this->plugin_name = 'pagefrog';
    72         $this->version = '1.0.7';
     72        $this->version = '1.0.7.1';
    7373
    7474        $this->load_dependencies();
     
    214214        $this->loader->add_action( 'amp_post_template_body_begin', $plugin_admin, 'add_analytics_to_amp' );
    215215        $this->loader->add_filter( 'amp_content_sanitizers', $plugin_admin, 'add_amp_ads_sanitizer', 10, 2 );
     216        $this->loader->add_filter( 'amp_post_template_metadata', $plugin_admin, 'add_logo_to_schema_org', 10, 2 );
    216217
    217218        // hooks for fbia rendering
  • pagefrog/trunk/pagefrog.php

    r1357722 r1359856  
    1616 * Plugin URI:        http://pagefrog.com/
    1717 * 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
     18 * Version:           1.0.7.1
    1919 * Author:            PageFrog Team
    2020 * Author URI:        http://pagefrog.com/
  • pagefrog/trunk/public/class-pagefrog-public.php

    r1338828 r1359856  
    4646    public function generate_instant_articles_feed() {
    4747
    48         $rss_template = PF__PLUGIN_DIR . 'templates/pagefrog-feed.php';
     48    $rss_template = PF__PLUGIN_DIR . 'templates/pagefrog-feed.php';
    4949        load_template($rss_template);
    5050    }
Note: See TracChangeset for help on using the changeset viewer.