Plugin Directory

Changeset 2624000


Ignore:
Timestamp:
11/03/2021 12:28:26 PM (4 years ago)
Author:
clearsite
Message:

Import changes from GitHub for version 1.0.13

Location:
branded-social-images/trunk
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • branded-social-images/trunk/css/admin.css

    r2620230 r2624000  
    9292    zoom: 0.21; }
    9393
    94 #branded-social-images-editor .area--background, #branded-social-images-editor .area--background-alternate, #branded-social-images-editor .area--background-canvas {
     94#branded-social-images-editor .area--background, #branded-social-images-editor .area--background-alternate, #branded-social-images-editor .area--background-canvas, #branded-social-images-editor .area--extra-layer {
    9595  width: 1200px;
    9696  height: 0;
  • branded-social-images/trunk/css/admin.scss

    r2620230 r2624000  
    130130  }
    131131
    132   .area--background, .area--background-alternate, .area--background-canvas {
     132  .area--background, .area--background-alternate, .area--background-canvas, .area--extra-layer {
    133133    width: 1200px;
    134134    height: 0;
  • branded-social-images/trunk/info.json

    r2620230 r2624000  
    55  "Author": "Internetbureau Clearsite",
    66  "Author URI": "https://www.clearsite.nl/",
    7   "Version": "1.0.12",
     7  "Version": "1.0.13",
    88  "License": "GPL2"
    99}
  • branded-social-images/trunk/lib/class.og-image-admin.php

    r2620230 r2624000  
    440440                    <div class="logo" style="background-image:url('<?php print plugins_url('img/example-logo.svg', __DIR__) ?>')"></div>
    441441                </div>
     442                <?php do_action('bsi_image_editor', 'after_creating_canvas'); ?>
    442443                <div class="area--background">
    443444                    <div class="background" style="background-image:url('<?php print esc_attr($image); ?>')"></div>
    444445                </div>
     446                <?php do_action('bsi_image_editor', 'after_adding_background'); ?>
    445447                <div class="area--logo">
    446448                    <div class="logo" style="background-image:url('<?php print esc_attr($logo); ?>')"></div>
    447449                </div>
     450                <?php do_action('bsi_image_editor', 'after_adding_logo'); ?>
    448451                <div class="area--text">
    449452                    <div class="editable-container">
     
    456459                    </div>
    457460                </div>
     461                <?php do_action('bsi_image_editor', 'after_adding_text'); ?>
    458462            </div>
    459463            <?php if (!$is_meta_panel) { ?>
  • branded-social-images/trunk/lib/class.og-image-gd.php

    r2620230 r2624000  
    5555        $this->resource = imagecreatetruecolor($w, $h);
    5656
    57         do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_creating_canvas']);
     57        do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_creating_canvas', $this->handler->post_id, $this->handler->image_id]);
    5858
    5959        imagealphablending($this->resource, true);
     
    8383        }
    8484
    85         do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_background']);
     85        do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_background', $this->handler->post_id, $this->handler->image_id]);
    8686    }
    8787
     
    245245        ]);
    246246
    247         do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_text']);
     247        do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_text', $this->handler->post_id, $this->handler->image_id]);
    248248    }
    249249
     
    338338        imagedestroy($logo);
    339339
    340         do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_logo']);
     340        do_action_ref_array('bsi_image_gd', [&$this->resource, 'after_adding_logo', $this->handler->post_id, $this->handler->image_id]);
    341341    }
    342342
  • branded-social-images/trunk/lib/class.og-image-plugin.php

    r2620230 r2624000  
    930930            self::getInstance()->page_already_has_og_image = true;
    931931        }
    932         return trailingslashit(untrailingslashit( get_bloginfo('url') ) . remove_query_arg(array_keys(!empty($_GET) ? $_GET : ['asd' => 1]))) . self::BSI_IMAGE_NAME . '/'; // yes, slash, WP will add it with a redirect anyway
     932
     933        // this consturction is to please WPML;
     934        // *_query_arg return domain-less root-based urls (/language/page/path/)
     935        // get_bloginfo('url') returns https://somesite.com/language/
     936        // we could use site_url, but this will be problematic with multi-site installations...
     937        $base_url = get_bloginfo('url');
     938        // from https://somesite.com/language/, keep only the base url, as the rest is included in the result from 'remove_query_arg'
     939        $base_url = parse_url($base_url, PHP_URL_SCHEME) .'://' . parse_url($base_url, PHP_URL_HOST); // no trailing slash
     940       
     941        return trailingslashit( $base_url . remove_query_arg(array_keys(!empty($_GET) ? $_GET : ['asd' => 1]))) . self::BSI_IMAGE_NAME . '/'; // yes, slash, WP will add it with a redirect anyway
    933942    }
    934943
     
    14081417        if (!is_admin() || $pagenow == 'post.php' || $pagenow == 'post-new.php') {
    14091418
     1419            $permalink = get_permalink(get_the_ID());
     1420            if (!parse_url($permalink, PHP_URL_HOST)) {
     1421                // somebody messed with the permalinks!
     1422                $permalink = trailingslashit( get_home_url() ) . ltrim( parse_url($permalink, PHP_URL_PATH), '/');
     1423            }
     1424
    14101425            if (
    14111426                defined('BSI_SHOW_ADMIN_BAR_IMAGE_LINK') &&
     
    14151430                    'id' => self::ADMIN_SLUG . '-view',
    14161431                    'title' => __('View Social Image', Plugin::TEXT_DOMAIN),
    1417                     'href' => get_permalink(get_the_ID()) . Plugin::BSI_IMAGE_NAME . '/',
     1432                    'href' => $permalink . Plugin::BSI_IMAGE_NAME . '/',
    14181433                    'meta' => [
    14191434                        'target' => '_blank',
     
    14341449            );
    14351450
    1436             $args['href'] = sprintf($args['href'], urlencode(get_permalink(get_the_ID())));
     1451            $args['href'] = sprintf($args['href'], urlencode($permalink));
    14371452            $admin_bar->add_node($args);
    14381453
  • branded-social-images/trunk/lib/class.og-image.php

    r2620230 r2624000  
    255255            }
    256256
     257            add_action('shutdown', function () use ($lock_file, $temp_file) {
     258                @unlink($lock_file);
     259                @unlink($temp_file);
     260            });
     261            if (!$this->use_cache) {
     262                add_action('shutdown', function () use ($cache_file) {
     263                    @unlink($cache_file);
     264                });
     265            }
     266
    257267            if (!empty($_GET['debug']) && $_GET['debug'] == 'BSI') {
    258268                Plugin::display_log();
     
    266276            }
    267277
    268             unlink($lock_file);
    269             if (!$this->use_cache) {
    270                 add_action('shutdown', function () use ($cache_file) { @unlink($cache_file); });
    271             }
    272278            return is_file($cache_file) ? $cache_file : false;
    273279        }
    274         unlink($lock_file);
     280
    275281        return false;
    276282    }
  • branded-social-images/trunk/readme.txt

    r2620230 r2624000  
    44Requires at least: 4.7
    55Tested up to: 5.8.1
    6 Stable tag: 1.0.12
     6Stable tag: 1.0.13
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    106106
    107107== Changelog ==
     108
     109= 1.0.13 =
     110* fixed: showing debug information leaves image cache in locked state, preventing (re-)generation of image.
     111* fixed: in WPML folder-per-language installation, the language folder is duplicated in the social-image-url
     112* fixed: some themes make all links relative, this breaks the admin-bar link to OpenGraph.xyz
     113* changed: action `bsi_image_gd` now includes two extra parameters: $post_id and $image_id
     114* added: action `bsi_image_editor` with 1 parameter; $stage, in 4 stages of displaying the editor (`after_creating_canvas`, `after_adding_background`, `after_adding_text` and `after_adding_logo`) for future expansion of the editor
    108115
    109116= 1.0.12 =
  • branded-social-images/trunk/wp-plugin.php

    r2620230 r2624000  
    66 * Author: Internetbureau Clearsite
    77 * Author URI: https://clearsite.nl/branded-social-images
    8  * Version: 1.0.12
     8 * Version: 1.0.13
    99 * License: GPL2
    1010 */
Note: See TracChangeset for help on using the changeset viewer.