Plugin Directory

Changeset 1505860


Ignore:
Timestamp:
09/30/2016 12:11:35 PM (10 years ago)
Author:
eoutvik
Message:

version 1.1

Location:
metamax
Files:
4 edited
8 copied

Legend:

Unmodified
Added
Removed
  • metamax/tags/1.1/appex-metamax.php

    r1501085 r1505860  
    33Plugin Name: MetaMax
    44Description: MetaMax automagically inserts meta tags in your html to make your site more SEO friendly.
    5 Version: 1.0
     5Version: 1.1
    66Author: Appex
    77Author URI: https://appex.no/
  • metamax/tags/1.1/includes/appex-metamax-defaults.php

    r1501036 r1505860  
    6363
    6464        if ( $post ) {
     65
     66            $post_thumbnail_id = null;
    6567
    6668            // Let's output the post thumbnail first, if it exists
     
    9294            }
    9395
    94             $attached_images = get_attached_media( 'image', $post->ID );
    95             $accepted_filetypes = array( 'png', 'jpg', 'jpeg', 'gif' );
    96             $minimum_image_dimensions = array( 200, 200 ); // Facebook's MINIMUM recommended width and height
    97 
    98             if ( count( $attached_images ) > 0 ) {
    99 
    100                 foreach ( $attached_images as $attached_image ) {
    101 
    102                     $attached_image_id = $attached_image->ID;
    103                     $attached_image_data = wp_get_attachment_image_src( $attached_image_id, 'full' );
    104                     $filetype = wp_check_filetype( $attached_image_data[0] );
    105 
    106                     if ( $i >= $maximum_number_of_images ) {
    107 
    108                         // Exit if maximum number of images has been reached
    109                         break;
    110 
    111                     }
    112                     elseif ( $attached_image_id == $post_thumbnail_id ) {
    113 
    114                         // Skip if post thumbnail
    115                         continue;
    116 
    117                     }
    118                     elseif ( !in_array( $filetype['ext'], $accepted_filetypes) ) {
    119 
    120                         // Skip unsupported image types
    121                         continue;
    122 
    123                     }
    124                     elseif ( $attached_image_data[1] < $minimum_image_dimensions[0] || $attached_image_data[2] < $minimum_image_dimensions[1] ) {
    125 
    126                         // Check the image dimensions
    127                         continue;
    128 
    129                     }
    130 
    131                     $document_images[] = Appex_Metamax_Defaults::get_document_image_data( $attached_image_data );
    132 
    133                     $i++;
    134 
    135                 }
    136 
    137             }
    138 
    13996        }
    14097
  • metamax/tags/1.1/readme.txt

    r1501085 r1505860  
    44Requires at least: 4.6
    55Tested up to: 4.6.1
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77Tags: SEO, Google, meta description, meta title, noindex, Facebook, Twitter, LinkedIn, search engine optimization
    88License: GPLv2 or later
     
    115115== Changelog ==
    116116
     117= 1.1 =
     118* Fixed undefined $post_thumbnail_id bug
     119* Removed attached images from og:image array
     120
    117121= 1.0 =
    118122* Initial release
  • metamax/trunk/appex-metamax.php

    r1501085 r1505860  
    33Plugin Name: MetaMax
    44Description: MetaMax automagically inserts meta tags in your html to make your site more SEO friendly.
    5 Version: 1.0
     5Version: 1.1
    66Author: Appex
    77Author URI: https://appex.no/
  • metamax/trunk/includes/appex-metamax-defaults.php

    r1501036 r1505860  
    6363
    6464        if ( $post ) {
     65
     66            $post_thumbnail_id = null;
    6567
    6668            // Let's output the post thumbnail first, if it exists
     
    9294            }
    9395
    94             $attached_images = get_attached_media( 'image', $post->ID );
    95             $accepted_filetypes = array( 'png', 'jpg', 'jpeg', 'gif' );
    96             $minimum_image_dimensions = array( 200, 200 ); // Facebook's MINIMUM recommended width and height
    97 
    98             if ( count( $attached_images ) > 0 ) {
    99 
    100                 foreach ( $attached_images as $attached_image ) {
    101 
    102                     $attached_image_id = $attached_image->ID;
    103                     $attached_image_data = wp_get_attachment_image_src( $attached_image_id, 'full' );
    104                     $filetype = wp_check_filetype( $attached_image_data[0] );
    105 
    106                     if ( $i >= $maximum_number_of_images ) {
    107 
    108                         // Exit if maximum number of images has been reached
    109                         break;
    110 
    111                     }
    112                     elseif ( $attached_image_id == $post_thumbnail_id ) {
    113 
    114                         // Skip if post thumbnail
    115                         continue;
    116 
    117                     }
    118                     elseif ( !in_array( $filetype['ext'], $accepted_filetypes) ) {
    119 
    120                         // Skip unsupported image types
    121                         continue;
    122 
    123                     }
    124                     elseif ( $attached_image_data[1] < $minimum_image_dimensions[0] || $attached_image_data[2] < $minimum_image_dimensions[1] ) {
    125 
    126                         // Check the image dimensions
    127                         continue;
    128 
    129                     }
    130 
    131                     $document_images[] = Appex_Metamax_Defaults::get_document_image_data( $attached_image_data );
    132 
    133                     $i++;
    134 
    135                 }
    136 
    137             }
    138 
    13996        }
    14097
  • metamax/trunk/readme.txt

    r1501085 r1505860  
    44Requires at least: 4.6
    55Tested up to: 4.6.1
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77Tags: SEO, Google, meta description, meta title, noindex, Facebook, Twitter, LinkedIn, search engine optimization
    88License: GPLv2 or later
     
    115115== Changelog ==
    116116
     117= 1.1 =
     118* Fixed undefined $post_thumbnail_id bug
     119* Removed attached images from og:image array
     120
    117121= 1.0 =
    118122* Initial release
Note: See TracChangeset for help on using the changeset viewer.