Changeset 2624000
- Timestamp:
- 11/03/2021 12:28:26 PM (4 years ago)
- Location:
- branded-social-images/trunk
- Files:
-
- 2 deleted
- 9 edited
-
admin/images (deleted)
-
css/admin.css (modified) (1 diff)
-
css/admin.scss (modified) (1 diff)
-
info.json (modified) (1 diff)
-
lib/class.og-image-admin.php (modified) (2 diffs)
-
lib/class.og-image-gd.php (modified) (4 diffs)
-
lib/class.og-image-plugin.php (modified) (4 diffs)
-
lib/class.og-image.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/bin (deleted)
-
wp-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branded-social-images/trunk/css/admin.css
r2620230 r2624000 92 92 zoom: 0.21; } 93 93 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 { 95 95 width: 1200px; 96 96 height: 0; -
branded-social-images/trunk/css/admin.scss
r2620230 r2624000 130 130 } 131 131 132 .area--background, .area--background-alternate, .area--background-canvas {132 .area--background, .area--background-alternate, .area--background-canvas, .area--extra-layer { 133 133 width: 1200px; 134 134 height: 0; -
branded-social-images/trunk/info.json
r2620230 r2624000 5 5 "Author": "Internetbureau Clearsite", 6 6 "Author URI": "https://www.clearsite.nl/", 7 "Version": "1.0.1 2",7 "Version": "1.0.13", 8 8 "License": "GPL2" 9 9 } -
branded-social-images/trunk/lib/class.og-image-admin.php
r2620230 r2624000 440 440 <div class="logo" style="background-image:url('<?php print plugins_url('img/example-logo.svg', __DIR__) ?>')"></div> 441 441 </div> 442 <?php do_action('bsi_image_editor', 'after_creating_canvas'); ?> 442 443 <div class="area--background"> 443 444 <div class="background" style="background-image:url('<?php print esc_attr($image); ?>')"></div> 444 445 </div> 446 <?php do_action('bsi_image_editor', 'after_adding_background'); ?> 445 447 <div class="area--logo"> 446 448 <div class="logo" style="background-image:url('<?php print esc_attr($logo); ?>')"></div> 447 449 </div> 450 <?php do_action('bsi_image_editor', 'after_adding_logo'); ?> 448 451 <div class="area--text"> 449 452 <div class="editable-container"> … … 456 459 </div> 457 460 </div> 461 <?php do_action('bsi_image_editor', 'after_adding_text'); ?> 458 462 </div> 459 463 <?php if (!$is_meta_panel) { ?> -
branded-social-images/trunk/lib/class.og-image-gd.php
r2620230 r2624000 55 55 $this->resource = imagecreatetruecolor($w, $h); 56 56 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]); 58 58 59 59 imagealphablending($this->resource, true); … … 83 83 } 84 84 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]); 86 86 } 87 87 … … 245 245 ]); 246 246 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]); 248 248 } 249 249 … … 338 338 imagedestroy($logo); 339 339 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]); 341 341 } 342 342 -
branded-social-images/trunk/lib/class.og-image-plugin.php
r2620230 r2624000 930 930 self::getInstance()->page_already_has_og_image = true; 931 931 } 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 933 942 } 934 943 … … 1408 1417 if (!is_admin() || $pagenow == 'post.php' || $pagenow == 'post-new.php') { 1409 1418 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 1410 1425 if ( 1411 1426 defined('BSI_SHOW_ADMIN_BAR_IMAGE_LINK') && … … 1415 1430 'id' => self::ADMIN_SLUG . '-view', 1416 1431 '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 . '/', 1418 1433 'meta' => [ 1419 1434 'target' => '_blank', … … 1434 1449 ); 1435 1450 1436 $args['href'] = sprintf($args['href'], urlencode( get_permalink(get_the_ID())));1451 $args['href'] = sprintf($args['href'], urlencode($permalink)); 1437 1452 $admin_bar->add_node($args); 1438 1453 -
branded-social-images/trunk/lib/class.og-image.php
r2620230 r2624000 255 255 } 256 256 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 257 267 if (!empty($_GET['debug']) && $_GET['debug'] == 'BSI') { 258 268 Plugin::display_log(); … … 266 276 } 267 277 268 unlink($lock_file);269 if (!$this->use_cache) {270 add_action('shutdown', function () use ($cache_file) { @unlink($cache_file); });271 }272 278 return is_file($cache_file) ? $cache_file : false; 273 279 } 274 unlink($lock_file); 280 275 281 return false; 276 282 } -
branded-social-images/trunk/readme.txt
r2620230 r2624000 4 4 Requires at least: 4.7 5 5 Tested up to: 5.8.1 6 Stable tag: 1.0.1 26 Stable tag: 1.0.13 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 106 106 107 107 == 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 108 115 109 116 = 1.0.12 = -
branded-social-images/trunk/wp-plugin.php
r2620230 r2624000 6 6 * Author: Internetbureau Clearsite 7 7 * Author URI: https://clearsite.nl/branded-social-images 8 * Version: 1.0.1 28 * Version: 1.0.13 9 9 * License: GPL2 10 10 */
Note: See TracChangeset
for help on using the changeset viewer.