🔞 ADULT: Changeset/ - HD Photos!

Changeset 3096912


Ignore:
Timestamp:
06/03/2024 06:16:36 PM (19 months ago)
Author:
wpscholar
Message:

Update to version 2.3.0 from GitHub

Location:
mpress-image-refresh
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mpress-image-refresh/tags/2.3.0/languages/mpress-image-refresh.pot

    r2753900 r3096912  
    1 # Copyright (C) 2020 Micah Wood
    2 # This file is distributed under the GPL3.
     1# Copyright (C) 2024 Micah Wood
     2# This file is distributed under the GPL V2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Image Refresh 2.1.1\n"
     5"Project-Id-Version: Image Refresh 2.3\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/mpress-image-refresh\n"
    8 "POT-Creation-Date: 2020-04-19 03:57:27+00:00\n"
     8"POT-Creation-Date: 2024-05-22 19:45:24+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
     12"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"Language-Team: LANGUAGE <[email protected]>\n"
    15 "X-Generator: node-wp-i18n 1.2.3\n"
     15"X-Generator: node-wp-i18n 1.2.7\n"
    1616
    17 #: mpress-image-refresh.php:101
     17#: mpress-image-refresh.php:71
     18msgid "Image Refresh Link URL"
     19msgstr ""
     20
     21#: mpress-image-refresh.php:204
     22#. translators: %d is the post ID
    1823msgid ""
    1924"Sorry, post ID \"%d\" is invalid. Please check your shortcode "
     
    2126msgstr ""
    2227
    23 #: mpress-image-refresh.php:123
     28#: mpress-image-refresh.php:239
    2429msgid ""
    2530"Sorry, it looks like you forgot to attach an image to the post or have "
     
    2732msgstr ""
    2833
    29 #: mpress-image-refresh.php:124
     34#: mpress-image-refresh.php:241
     35#. translators: %s is the shortcode implementation
    3036msgid "Please check your %s shortcode implementation."
    3137msgstr ""
    3238
    33 #: mpress-image-refresh.php:147
     39#: mpress-image-refresh.php:265
     40#. translators: %d is the attachment ID
    3441msgid ""
    3542"Sorry, attachment ID \"%d\" is invalid. Please check your shortcode "
     
    3744msgstr ""
    3845
    39 #: mpress-image-refresh.php:176
     46#: mpress-image-refresh.php:296
     47#. translators: %1$s is the invalid image size, %2$s is the default image size
     48#. being used.
    4049msgid ""
    41 "Sorry, image size \"%s\" is invalid. Defaulting to \"%s\" image size. "
     50"Sorry, image size \"%1$s\" is invalid. Defaulting to \"%2$s\" image size. "
    4251"Please check your shortcode implementation."
    4352msgstr ""
     
    6069
    6170#. Author URI of the plugin/theme
    62 msgid "http://wpscholar.com"
     71msgid "https://wpscholar.com"
    6372msgstr ""
  • mpress-image-refresh/tags/2.3.0/mpress-image-refresh.php

    r2764141 r3096912  
    55 * @package           ImageRefresh
    66 * @author            Micah Wood
    7  * @copyright         Copyright 2014-2022 by Micah Wood - All rights reserved.
     7 * @copyright         Copyright 2014-2024 by Micah Wood - All rights reserved.
    88 * @license           GPL2.0-or-later
    99 *
     
    1212 * Plugin URI:        http://wpscholar.com/wordpress-plugins/mpress-image-refresh/
    1313 * Description:       Show a fresh image on every page load.
    14  * Version:           2.2.1
     14 * Version:           2.3
    1515 * Requires PHP:      5.4
    1616 * Requires at least: 4.5
     
    4848         */
    4949        public static function initialize() {
    50             load_plugin_textdomain( 'mpress-image-refresh', false, dirname( __FILE__ ) . '/languages' );
     50            load_plugin_textdomain( 'mpress-image-refresh', false, __DIR__ . '/languages' );
    5151            add_action( 'wp_enqueue_scripts', array( __CLASS__, 'wp_enqueue_scripts' ) );
    5252            add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'add_external_url_field' ), 10, 2 );
     
    7575
    7676            return $img_fields;
    77 
    7877        }
    7978
     
    192191            $atts['post_id']        = absint( $atts['post_id'] );
    193192            $atts['exclude']        = self::parse_id_list( $atts['exclude'] );
    194             $atts['attachment_ids'] = self::parse_id_list( $atts['attachment_ids'] );
     193            $atts['attachment_ids'] = self::parse_conditional_values( $atts['attachment_ids'] );
    195194            $atts['caption']        = filter_var( $atts['caption'], FILTER_VALIDATE_BOOLEAN );
    196195
     
    329328
    330329        /**
     330         * Parse values with conditional subsets.
     331         *
     332         * For example: 9,10,11|12|13 - Selects based on comma-separation, but if the third option is selected, it randomly selects between numbers separated by a "|" character.
     333         *
     334         * @param string $id_list A comma separated list of IDs.
     335         *
     336         * @return int[]
     337         */
     338        public static function parse_conditional_values( $id_list ) {
     339            $items = explode( ',', $id_list );
     340            foreach ( $items as $key => $item ) {
     341                if ( strpos( $item, '|' ) !== false ) {
     342                    $values = array_filter( array_map( 'absint', explode( '|', $item ) ) );
     343                    if ( $values && is_array( $values ) ) {
     344                        $selected      = array_rand( $values, 1 );
     345                        $items[ $key ] = $values[ $selected ];
     346                    } else {
     347                        unset( $items[ $key ] );
     348                    }
     349                }
     350            }
     351            return array_filter( array_map( 'absint', $items ) );
     352        }
     353
     354        /**
    331355         * Parse an ID list into an array.
    332356         *
    333          * @param string $list A comma separated list of IDs.
     357         * @param string $id_list A comma separated list of IDs.
    334358         *
    335359         * @return int[]
    336360         */
    337         public static function parse_id_list( $list ) {
     361        public static function parse_id_list( $id_list ) {
    338362            $ids = array();
    339             if ( ! empty( $list ) ) {
    340                 $ids = array_filter( array_map( 'absint', explode( ',', preg_replace( '#[^0-9,]#', '', $list ) ) ) );
     363            if ( ! empty( $id_list ) ) {
     364                $ids = array_filter( array_map( 'absint', explode( ',', preg_replace( '#[^0-9,]#', '', $id_list ) ) ) );
    341365            }
    342366
     
    363387            );
    364388        }
    365 
    366389    }
    367390
  • mpress-image-refresh/tags/2.3.0/readme.txt

    r2764141 r3096912  
    55Requires at least: 4.5
    66Requires PHP: 5.4
    7 Tested up to: 6.0
    8 Stable tag: 2.2.1
     7Tested up to: 6.5
     8Stable tag: 2.3
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6666The `[mpress_image_refresh]` shortcode supports a few attributes to give you more control over the results:
    6767
    68 * **attachment** - You can pass in a comma separated list of image IDs if you want to directly specify a set of images to use. Using this attribute invalidates the `post_id` and `not` attributes. Example: `[mpress_image_refresh attachment="19, 37, 940"]`
     68* **attachment** - You can pass in a comma separated list of image IDs if you want to directly specify a set of images to use. Using this attribute invalidates the `post_id` and `not` attributes. Example: `[mpress_image_refresh attachment="19, 37, 940"]` Optionally, you can also have the shortcode randomly pull from a subset using this syntax: `[mpress_image_refresh attachment="19,37,940|453|98"]`
    6969
    7070* **post_id** - You can pass in the post ID to pull attached images from.  If your images are attached to another post, just provide the ID of that post and we will pull those images instead.  Example: `[mpress_image_refresh post_id="19"]`
     
    8888
    8989== Changelog ==
     90
     91= 2.3 =
     92
     93* Update compatibility with WP 6.5
     94* Add ability to randomly select an attachment ID from a subset.
    9095
    9196= 2.2.1 =
     
    138143== Upgrade Notice ==
    139144
     145= 2.3 =
     146
     147* Add new feature to shortcode to allow random subsets
     148
    140149= 2.2.1 =
    141150
  • mpress-image-refresh/trunk/languages/mpress-image-refresh.pot

    r2753900 r3096912  
    1 # Copyright (C) 2020 Micah Wood
    2 # This file is distributed under the GPL3.
     1# Copyright (C) 2024 Micah Wood
     2# This file is distributed under the GPL V2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Image Refresh 2.1.1\n"
     5"Project-Id-Version: Image Refresh 2.3\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/mpress-image-refresh\n"
    8 "POT-Creation-Date: 2020-04-19 03:57:27+00:00\n"
     8"POT-Creation-Date: 2024-05-22 19:45:24+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
     12"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"Language-Team: LANGUAGE <[email protected]>\n"
    15 "X-Generator: node-wp-i18n 1.2.3\n"
     15"X-Generator: node-wp-i18n 1.2.7\n"
    1616
    17 #: mpress-image-refresh.php:101
     17#: mpress-image-refresh.php:71
     18msgid "Image Refresh Link URL"
     19msgstr ""
     20
     21#: mpress-image-refresh.php:204
     22#. translators: %d is the post ID
    1823msgid ""
    1924"Sorry, post ID \"%d\" is invalid. Please check your shortcode "
     
    2126msgstr ""
    2227
    23 #: mpress-image-refresh.php:123
     28#: mpress-image-refresh.php:239
    2429msgid ""
    2530"Sorry, it looks like you forgot to attach an image to the post or have "
     
    2732msgstr ""
    2833
    29 #: mpress-image-refresh.php:124
     34#: mpress-image-refresh.php:241
     35#. translators: %s is the shortcode implementation
    3036msgid "Please check your %s shortcode implementation."
    3137msgstr ""
    3238
    33 #: mpress-image-refresh.php:147
     39#: mpress-image-refresh.php:265
     40#. translators: %d is the attachment ID
    3441msgid ""
    3542"Sorry, attachment ID \"%d\" is invalid. Please check your shortcode "
     
    3744msgstr ""
    3845
    39 #: mpress-image-refresh.php:176
     46#: mpress-image-refresh.php:296
     47#. translators: %1$s is the invalid image size, %2$s is the default image size
     48#. being used.
    4049msgid ""
    41 "Sorry, image size \"%s\" is invalid. Defaulting to \"%s\" image size. "
     50"Sorry, image size \"%1$s\" is invalid. Defaulting to \"%2$s\" image size. "
    4251"Please check your shortcode implementation."
    4352msgstr ""
     
    6069
    6170#. Author URI of the plugin/theme
    62 msgid "http://wpscholar.com"
     71msgid "https://wpscholar.com"
    6372msgstr ""
  • mpress-image-refresh/trunk/mpress-image-refresh.php

    r2764141 r3096912  
    55 * @package           ImageRefresh
    66 * @author            Micah Wood
    7  * @copyright         Copyright 2014-2022 by Micah Wood - All rights reserved.
     7 * @copyright         Copyright 2014-2024 by Micah Wood - All rights reserved.
    88 * @license           GPL2.0-or-later
    99 *
     
    1212 * Plugin URI:        http://wpscholar.com/wordpress-plugins/mpress-image-refresh/
    1313 * Description:       Show a fresh image on every page load.
    14  * Version:           2.2.1
     14 * Version:           2.3
    1515 * Requires PHP:      5.4
    1616 * Requires at least: 4.5
     
    4848         */
    4949        public static function initialize() {
    50             load_plugin_textdomain( 'mpress-image-refresh', false, dirname( __FILE__ ) . '/languages' );
     50            load_plugin_textdomain( 'mpress-image-refresh', false, __DIR__ . '/languages' );
    5151            add_action( 'wp_enqueue_scripts', array( __CLASS__, 'wp_enqueue_scripts' ) );
    5252            add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'add_external_url_field' ), 10, 2 );
     
    7575
    7676            return $img_fields;
    77 
    7877        }
    7978
     
    192191            $atts['post_id']        = absint( $atts['post_id'] );
    193192            $atts['exclude']        = self::parse_id_list( $atts['exclude'] );
    194             $atts['attachment_ids'] = self::parse_id_list( $atts['attachment_ids'] );
     193            $atts['attachment_ids'] = self::parse_conditional_values( $atts['attachment_ids'] );
    195194            $atts['caption']        = filter_var( $atts['caption'], FILTER_VALIDATE_BOOLEAN );
    196195
     
    329328
    330329        /**
     330         * Parse values with conditional subsets.
     331         *
     332         * For example: 9,10,11|12|13 - Selects based on comma-separation, but if the third option is selected, it randomly selects between numbers separated by a "|" character.
     333         *
     334         * @param string $id_list A comma separated list of IDs.
     335         *
     336         * @return int[]
     337         */
     338        public static function parse_conditional_values( $id_list ) {
     339            $items = explode( ',', $id_list );
     340            foreach ( $items as $key => $item ) {
     341                if ( strpos( $item, '|' ) !== false ) {
     342                    $values = array_filter( array_map( 'absint', explode( '|', $item ) ) );
     343                    if ( $values && is_array( $values ) ) {
     344                        $selected      = array_rand( $values, 1 );
     345                        $items[ $key ] = $values[ $selected ];
     346                    } else {
     347                        unset( $items[ $key ] );
     348                    }
     349                }
     350            }
     351            return array_filter( array_map( 'absint', $items ) );
     352        }
     353
     354        /**
    331355         * Parse an ID list into an array.
    332356         *
    333          * @param string $list A comma separated list of IDs.
     357         * @param string $id_list A comma separated list of IDs.
    334358         *
    335359         * @return int[]
    336360         */
    337         public static function parse_id_list( $list ) {
     361        public static function parse_id_list( $id_list ) {
    338362            $ids = array();
    339             if ( ! empty( $list ) ) {
    340                 $ids = array_filter( array_map( 'absint', explode( ',', preg_replace( '#[^0-9,]#', '', $list ) ) ) );
     363            if ( ! empty( $id_list ) ) {
     364                $ids = array_filter( array_map( 'absint', explode( ',', preg_replace( '#[^0-9,]#', '', $id_list ) ) ) );
    341365            }
    342366
     
    363387            );
    364388        }
    365 
    366389    }
    367390
  • mpress-image-refresh/trunk/readme.txt

    r2764141 r3096912  
    55Requires at least: 4.5
    66Requires PHP: 5.4
    7 Tested up to: 6.0
    8 Stable tag: 2.2.1
     7Tested up to: 6.5
     8Stable tag: 2.3
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6666The `[mpress_image_refresh]` shortcode supports a few attributes to give you more control over the results:
    6767
    68 * **attachment** - You can pass in a comma separated list of image IDs if you want to directly specify a set of images to use. Using this attribute invalidates the `post_id` and `not` attributes. Example: `[mpress_image_refresh attachment="19, 37, 940"]`
     68* **attachment** - You can pass in a comma separated list of image IDs if you want to directly specify a set of images to use. Using this attribute invalidates the `post_id` and `not` attributes. Example: `[mpress_image_refresh attachment="19, 37, 940"]` Optionally, you can also have the shortcode randomly pull from a subset using this syntax: `[mpress_image_refresh attachment="19,37,940|453|98"]`
    6969
    7070* **post_id** - You can pass in the post ID to pull attached images from.  If your images are attached to another post, just provide the ID of that post and we will pull those images instead.  Example: `[mpress_image_refresh post_id="19"]`
     
    8888
    8989== Changelog ==
     90
     91= 2.3 =
     92
     93* Update compatibility with WP 6.5
     94* Add ability to randomly select an attachment ID from a subset.
    9095
    9196= 2.2.1 =
     
    138143== Upgrade Notice ==
    139144
     145= 2.3 =
     146
     147* Add new feature to shortcode to allow random subsets
     148
    140149= 2.2.1 =
    141150
Note: See TracChangeset for help on using the changeset viewer.