Plugin Directory

Changeset 2887963


Ignore:
Timestamp:
03/28/2023 02:58:30 AM (3 years ago)
Author:
tildapublishing
Message:

0.3.19 - Fix saving images locally

Location:
tilda-publishing
Files:
4 edited
19 copied

Legend:

Unmodified
Added
Removed
  • tilda-publishing/tags/0.3.19/class.tilda-admin.php

    r2810708 r2887963  
    11741174        $matches = [];
    11751175        if ( preg_match_all( '/s\.src="([a-z0-9-.]+\.min\.js)";/i', $tildapage->html, $matches ) ) {
    1176             $checked_matches = isset($matches[0]) ? $matches[0] : [];
     1176            $checked_matches = isset( $matches[0] ) ? $matches[0] : [];
    11771177            foreach ( $checked_matches as $key => $match ) {
    11781178                if ( ! empty( $matches[1][ $key ] ) ) {
     
    11841184        $matches = [];
    11851185        if ( preg_match_all( '/<script src="([a-z0-9-.]+\.min\.js)">/i', $tildapage->html, $matches ) ) {
    1186             $checked_matches = isset($matches[0]) ? $matches[0] : [];
     1186            $checked_matches = isset( $matches[0] ) ? $matches[0] : [];
    11871187            foreach ( $checked_matches as $key => $match ) {
    11881188                if ( ! empty( $matches[1][ $key ] ) ) {
     
    13891389
    13901390                    /* replace  short jQuery function $(...) to jQuery(...) */
    1391                     if ( strpos( $file['to_dir'], 'tilda-blocks-' ) > 0 && strpos( $file['to_dir'], '.js' ) > 0 ) {
     1391                    if (
     1392                        strpos( $file['to_dir'], 'tilda-blocks-' ) !== false
     1393                        && strpos( $file['to_dir'], '.js' ) !== false
     1394                    ) {
    13921395                        $content = str_replace( '$(', 'jQuery(', $content );
    13931396                        $content = str_replace( '$.', 'jQuery.', $content );
    13941397                    }
    13951398
    1396                     $ext = strtolower( substr( $file['from_url'], - 4 ) );
     1399                    $parts     = explode( '.', strtolower( $file['from_url'] ) );
     1400                    $extension = array_pop( $parts );
     1401
    13971402                    if (
    1398                         ! in_array( $ext, [ '.jpg', '.png', '.gif', 'jpeg' ] )
    1399                         && strpos( $content, 'The resource could not be found.' ) === false
    1400                         && strpos( strtolower( $content ), 'not found.' ) === false
    1401                         && file_put_contents( $file['to_dir'], $content ) === false
     1403                        in_array( $extension, [ 'jpg', 'jpeg', 'png', 'gif', 'svg', 'ico' ] )
     1404                        && (
     1405                            strpos( $content, 'The resource could not be found.' ) !== false
     1406                            || strpos( strtolower( $content ), 'not found.' ) !== false
     1407                        )
    14021408                    ) {
     1409                        $downloaded ++;
     1410                        continue;
     1411                    } elseif ( file_put_contents( $file['to_dir'], $content ) === false ) {
    14031412                        Tilda::$errors->add( 'error_download', 'Cannot save file to [' . $file['to_dir'] . '].' );
    14041413                        echo Tilda::json_errors();
  • tilda-publishing/tags/0.3.19/class.tilda.php

    r2788205 r2887963  
    77class Tilda {
    88    private static $initiated = false;
     9    /**
     10     * @var WP_Error
     11     */
    912    public static $errors;
    1013    public static $active_on_page = null;
  • tilda-publishing/tags/0.3.19/readme.txt

    r2810708 r2887963  
    44Tags: blog, bulk, convert, crawl, data, import, importer, migrate, move, posts, publishing, tilda, export
    55Requires at least: 3.0.1
    6 Tested up to: 6.0.2
    7 Stable tag: 0.3.18
     6Tested up to: 6.1.1
     7Stable tag: 0.3.19
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050Q: Where can I find the official repository for this plugin?
    51 A: Please find the official repository on this [GitHub page](https://github.com/greensun7/tilda-wordpress-plugin).
     51A: Please find the official repository on this [GitHub page](https://github.com/TildaPublishingOfficial/tilda-wordpress-plugin).
    5252
    5353Q: Something’s broken / I have a great idea, how can I contact you?
    54 A: Please create an issue on the [GitHub page](https://github.com/greensun7/tilda-wordpress-plugin) or email [email protected]. Creating a pull request is an even better option.
     54A: Please create an issue on the [GitHub page](https://github.com/TildaPublishingOfficial/tilda-wordpress-plugin) or email [email protected]. Creating a pull request is an even better option.
    5555
    5656
     
    6262
    6363== Changelog ==
     64
     65= 0.3.19 =
     66* Fix saving images locally
    6467
    6568= 0.3.18 =
  • tilda-publishing/tags/0.3.19/tilda-wordpress-plugin.php

    r2810708 r2887963  
    33Plugin Name: Tilda Publishing
    44Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению.
    5 Version: 0.3.18
     5Version: 0.3.19
    66Author: Tilda Publishing
    77License: GPLv2 or later
    88Text Domain: api tilda
     9
     10Update 0.3.19 - fix saving images locally
    911
    1012Update 0.3.18 - add backward compatibility
     
    119121}
    120122
    121 define( 'TILDA_VERSION', '0.3.14' );
     123define( 'TILDA_VERSION', '0.3.19' );
    122124define( 'TILDA_MINIMUM_WP_VERSION', '3.1' );
    123125define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • tilda-publishing/trunk/class.tilda-admin.php

    r2810708 r2887963  
    11741174        $matches = [];
    11751175        if ( preg_match_all( '/s\.src="([a-z0-9-.]+\.min\.js)";/i', $tildapage->html, $matches ) ) {
    1176             $checked_matches = isset($matches[0]) ? $matches[0] : [];
     1176            $checked_matches = isset( $matches[0] ) ? $matches[0] : [];
    11771177            foreach ( $checked_matches as $key => $match ) {
    11781178                if ( ! empty( $matches[1][ $key ] ) ) {
     
    11841184        $matches = [];
    11851185        if ( preg_match_all( '/<script src="([a-z0-9-.]+\.min\.js)">/i', $tildapage->html, $matches ) ) {
    1186             $checked_matches = isset($matches[0]) ? $matches[0] : [];
     1186            $checked_matches = isset( $matches[0] ) ? $matches[0] : [];
    11871187            foreach ( $checked_matches as $key => $match ) {
    11881188                if ( ! empty( $matches[1][ $key ] ) ) {
     
    13891389
    13901390                    /* replace  short jQuery function $(...) to jQuery(...) */
    1391                     if ( strpos( $file['to_dir'], 'tilda-blocks-' ) > 0 && strpos( $file['to_dir'], '.js' ) > 0 ) {
     1391                    if (
     1392                        strpos( $file['to_dir'], 'tilda-blocks-' ) !== false
     1393                        && strpos( $file['to_dir'], '.js' ) !== false
     1394                    ) {
    13921395                        $content = str_replace( '$(', 'jQuery(', $content );
    13931396                        $content = str_replace( '$.', 'jQuery.', $content );
    13941397                    }
    13951398
    1396                     $ext = strtolower( substr( $file['from_url'], - 4 ) );
     1399                    $parts     = explode( '.', strtolower( $file['from_url'] ) );
     1400                    $extension = array_pop( $parts );
     1401
    13971402                    if (
    1398                         ! in_array( $ext, [ '.jpg', '.png', '.gif', 'jpeg' ] )
    1399                         && strpos( $content, 'The resource could not be found.' ) === false
    1400                         && strpos( strtolower( $content ), 'not found.' ) === false
    1401                         && file_put_contents( $file['to_dir'], $content ) === false
     1403                        in_array( $extension, [ 'jpg', 'jpeg', 'png', 'gif', 'svg', 'ico' ] )
     1404                        && (
     1405                            strpos( $content, 'The resource could not be found.' ) !== false
     1406                            || strpos( strtolower( $content ), 'not found.' ) !== false
     1407                        )
    14021408                    ) {
     1409                        $downloaded ++;
     1410                        continue;
     1411                    } elseif ( file_put_contents( $file['to_dir'], $content ) === false ) {
    14031412                        Tilda::$errors->add( 'error_download', 'Cannot save file to [' . $file['to_dir'] . '].' );
    14041413                        echo Tilda::json_errors();
  • tilda-publishing/trunk/class.tilda.php

    r2788205 r2887963  
    77class Tilda {
    88    private static $initiated = false;
     9    /**
     10     * @var WP_Error
     11     */
    912    public static $errors;
    1013    public static $active_on_page = null;
  • tilda-publishing/trunk/readme.txt

    r2810708 r2887963  
    44Tags: blog, bulk, convert, crawl, data, import, importer, migrate, move, posts, publishing, tilda, export
    55Requires at least: 3.0.1
    6 Tested up to: 6.0.2
    7 Stable tag: 0.3.18
     6Tested up to: 6.1.1
     7Stable tag: 0.3.19
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050Q: Where can I find the official repository for this plugin?
    51 A: Please find the official repository on this [GitHub page](https://github.com/greensun7/tilda-wordpress-plugin).
     51A: Please find the official repository on this [GitHub page](https://github.com/TildaPublishingOfficial/tilda-wordpress-plugin).
    5252
    5353Q: Something’s broken / I have a great idea, how can I contact you?
    54 A: Please create an issue on the [GitHub page](https://github.com/greensun7/tilda-wordpress-plugin) or email [email protected]. Creating a pull request is an even better option.
     54A: Please create an issue on the [GitHub page](https://github.com/TildaPublishingOfficial/tilda-wordpress-plugin) or email [email protected]. Creating a pull request is an even better option.
    5555
    5656
     
    6262
    6363== Changelog ==
     64
     65= 0.3.19 =
     66* Fix saving images locally
    6467
    6568= 0.3.18 =
  • tilda-publishing/trunk/tilda-wordpress-plugin.php

    r2810708 r2887963  
    33Plugin Name: Tilda Publishing
    44Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению.
    5 Version: 0.3.18
     5Version: 0.3.19
    66Author: Tilda Publishing
    77License: GPLv2 or later
    88Text Domain: api tilda
     9
     10Update 0.3.19 - fix saving images locally
    911
    1012Update 0.3.18 - add backward compatibility
     
    119121}
    120122
    121 define( 'TILDA_VERSION', '0.3.14' );
     123define( 'TILDA_VERSION', '0.3.19' );
    122124define( 'TILDA_MINIMUM_WP_VERSION', '3.1' );
    123125define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.