Giter Club home page Giter Club logo

the-paste's People

Contributors

aurorum-studio avatar awestuk avatar dependabot[bot] avatar donbowman avatar mcguffin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

the-paste's Issues

PHP8.0 No the-paste

PHP 8.0
WordPress 5.8

Warning: The magic method ThePaste\Core\Singleton::__wakeup() must have public visibility in

issues with copy/paste within the same document

ugraded to 2.0.9 and I still have two issues:
image

I created a new document and added a screenshot to it. Then copied it over and over with some sample text. The following two issues occured:

  1. Once in a while, I get an error that I described previously (you can see in the screenshot).
  2. When I copy or cut/paste - it re-uploads the images each time, so I get a lot of duplicated images.

It should check if the image is already uploaded or originates from the current site (in which case, it shouldn't be re-uploaded).

I think we need a google docs button that should turn on/off the HTML behavior and also be able to control the default state of this button.

@mcguffin thanks!

not able to change image name, and stays constantly as "image"

Hi, thank you for the great work and your amazingly fast response time with the issues.

I just came across another fairly important issue which I thought I'd mention here.

After the image is pasted in the library (CTRL-V), next the window opens that provides the option of typing the image name and the file type. At this point onwards, whatever you put in the text box, the image name remains the same so does the image title after the photo is uploaded, the both stay as "image". The next image uploaded would be forced named as "image-1.png".

The next issue regarding image name is that, if I am copying the image name as text from somewhere else, the paste screen still either captures the text as a new image to import, or when the cursor is in the text box, the CTRL-V or paste doesnt work and the image name remains constantly as "image" as described above.

Also if you're trying to paste image description etc, it will be pasted as a new image unless i use the "paste" option in the context menu.

Thank you for looking into this.

Fatal error when using Elementor Theme Builder

When using Elementor we're getting a fatal error when The Paste is installed. To replicate:

  • Install Elementor & The Paste
  • Attempt to open Elementor Theme Builder (will cause the fatal error)

Below are details:

An error of type E_ERROR was caused in line 129 of the file /home/nginx/domains//public/wp-content/plugins/the-paste/include/ThePaste/Admin/Admin.php. Error message: Uncaught Error: Call to a member function enqueue() on null in /home/nginx/domains//public/wp-content/plugins/the-paste/include/ThePaste/Admin/Admin.php:129
Stack trace:
#0 /home/nginx/domains//public/wp-includes/class-wp-hook.php(308): ThePaste\Admin\Admin->enqueue_assets()
#1 /home/nginx/domains//public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#2 /home/nginx/domains//public/wp-includes/plugin.php(517): WP_Hook->do_action()
#3 /home/nginx/domains//public/wp-includes/media.php(4747): do_action()
#4 /home/nginx/domains//public/wp-content/plugins/elementor/app/modules/onboarding/module.php(460): wp_enqueue_media()
#5 /home/nginx/domains//public/wp-includes/class-wp-hook.php(308): Elementor\App\Modules\Onboarding\Module->Elementor\App\Modules\Onboarding{closure}()
#6 /home/nginx/domains//public/wp-inclu

Thrive Themes page builder

This plugin is awesome, but it doesn’t seem to work with Thrive Architect page builder (from Thrive Themes). Any chance you can create an update that fixes the issue with that?

new upload images button issues

  1. The button is empty (no ::before content like other mce toolbar buttons)
    image

  2. There is no way to hide the button (it should be allowed somehow, on the user profile for example).

  3. Advanced editor tools (https://wordpress.org/plugins/tinymce-advanced/) is another possible way to manage the icon (it's how I manage the rest of the icons in that toolbar), however it's not on the list:
    image

Problem when pasting from Microsoft exel

Version used: The Paste 2.0.5

When I paste information from Microsoft Excel when writing a post, The Paste inserts an image instead of a table.

I know that Microsoft Exel, when copying to the clipboard, puts it into many formats, including as an image.
But can something be done about it? It causes some problems when writing texts with tables.

Trying to activate filters unsccessfuly

this doesn't seem to do the trick:

function the_paste_default_filename() {
	return "Pasted";
}
function the_paste_max_embed_image_size() {
	return 1;
}
add_action( 'the_paste_default_filename', 'the_paste_default_filename');
add_action( 'the_paste_max_embed_image_size', 'the_paste_max_embed_image_size');

Is there an example of how to use these two filters?

Images not linking to full-size image

Hi, in The Paste 2.0.9 I'm noticing that images don't by default link to their full-size version, so they're no longer clickable after being pasted. Really the only difference here is that the href tag is missing:

In paste 2.0.9:

<img class="wp-image-53665 alignnone size-medium" src="https://mysite.xyz/wordpress/wp-content/uploads/2023/10/image-23.png" alt="" width="300" height="241" />
<p id="the-pasted-async"></p>

How it it used to be / how I'd like it to be:

<a href="https://mysite.xyz/wordpress/wp-content/uploads/2023/10/image-23.png"><img class="alignnone wp-image-53665 size-medium" src="https://mysite.xyz/wordpress/wp-content/uploads/2023/10/image-23.png" alt="" width="300" height="241" /></a>`

Problem after installing The Paste 2+

I use the classic editor and additionally the Advanced Editor Tools plugin (TinyMCE).

After installing The Paste 2 the background of creating new posts became gray, if you disable the plugin, everything returns to normal.

This creates certain inconveniences when writing new posts.
Installing 2.0.3 didn't solve the problem

There was a critical error after update to 2.0.1 (2.0.0 in changelog?).

Hi,

I face a critical error after update to the newest version, and the admin dashboard is down because of the error. Everything went ok when I restored my backup which is not using the updated "The-Paste". I even tried to update again, and exactly the same error occured. Here is the info in error log. Private information is replaced with "*". I'm not very sure why the function "wp_is_mobile()" is undefined, since I read this in a wp official document before, but I can't test it myself since the website I'm operating can't be down, and I'm too busy. I'll keep using the old version until there is a solution, I really like the plugin, and appreciate your work. Hope to receive a reply soon.

Best regards,
Xavier

Stack trace:
#0 /***/wp-content/plugins/the-paste/include/ThePaste/Core/Singleton.php(28): ThePaste\Admin\Admin->__construct()
#1 /***/wp-content/plugins/the-paste/index.php(45): ThePaste\Core\Singleton::instance()
#2 /***/wp-settings.php(407): include_once('/***')
#3 /***/wp-config.php(118): require_once('/***')
#4 /***/wp-load.php(50): require_once('/***')
#5 /***/wp-admin/admin.php(34): require_once('/***')
#6 /***/wp-admin/index.php(10): require_once('/***')
#7 {main}
  thrown in /***/wp-content/plugins/the-paste/include/ThePaste/Admin/Admin.php on line 28
`

capabilities issue on multisite

Getting this error:

Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in /home/mysite/public_html/wp-includes/capabilities.php:801 Stack trace: #0 /home/mysite/public_html/wp-includes/class-wp-user.php(778): map_meta_cap(Object(WP_User), 1, 'edit_pages') #1 /home/mysite/public_html/wp-includes/capabilities.php(981): WP_User->has_cap(Object(WP_User), 'edit_pages') #2 /home/mysite/public_html/wp-includes/capabilities.php(873): user_can(Object(WP_User), Object(WP_User), 'edit_pages') #3 /home/mysite/public_html/wp-content/plugins/the-paste/include/ThePaste/Admin/User.php(59): current_user_can(Object(WP_User), 'edit_pages') #4 /home/mysite/public_html/wp-includes/class-wp-hook.php(308): ThePaste\Admin\User->personal_options(Object(WP_User)) #5 /home/mysite/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #6 /home/mysite/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #7 /home/mysite/public_html/wp-admin/user-edit.php(394): do_action('personal_option...', Object(WP_User)) #8 /home/mysite/public_html/wp-admin/network/user-edit.php(13): require('/home/mysite/p...') #9 {main} thrown in /home/mysite/public_html/wp-includes/capabilities.php on line 801

To fix:

Locate this file - wp-content\plugins\the-paste\include\ThePaste\Admin\User.php

Replace this line:
$can_edit = user_can( $profile_user, 'edit_posts' ) || current_user_can( $profile_user, 'edit_pages' );

With this line:
$can_edit = user_can( $profile_user, 'edit_posts' ) || current_user_can( 'edit_pages' );

Reason for error:
In the personal_options() method, you're passing a WP_User object to current_user_can(). It should instead be a string representing the capability you want to check.

Fix explained:
In the revised line of code, I've replaced $profile_user with 'edit_pages' in the current_user_can() function. Now, the function is receiving the capability you're checking for as a string, which should eliminate the error.

Does not work with MS Word on Windows

Saving the picture from Word and opening it in Windows 10 Photos app, ctrl-c and ctrl-v into Chrome works.

But copying the picture from Word and pasting into Chrome gives this error:

Uncaught TypeError: Cannot read properties of null (reading 'type')
    at wp-tinymce.js?ver=49110-20201110:27:21065
    at Rt.s (wp-tinymce.js?ver=49110-20201110:27:20967)
    at Rt (wp-tinymce.js?ver=49110-20201110:27:20994)
    at tN.<anonymous> (wp-tinymce.js?ver=49110-20201110:27:23335)
    at vp.c.fire (wp-tinymce.js?ver=49110-20201110:3:197006)
    at tN.fire (wp-tinymce.js?ver=49110-20201110:3:197532)
    at Pp (wp-tinymce.js?ver=49110-20201110:3:199169)
    at Object.t (wp-tinymce.js?ver=49110-20201110:3:199644)
    at C (wp-tinymce.js?ver=49110-20201110:3:10800)
    at HTMLBodyElement.d (wp-tinymce.js?ver=49110-20201110:3:10946)```

Critical Error when trying to access User Profile

I love this plugin! However, recently it’s started causing a critical error when trying to access the Edit User page.

Capture

This happens even with all other plugins disabled and when using a default Twenty Twenty theme.

Is there any resolution for this?

Thank you!

How to have the "Easy FancyBox" plugin effect applied on to of "the paste" plugin

When pasting images directly in the WordPress text editor, the plugin "Easy FancyBox" do not apply automatically.

Theoretically, after activation of "Easy Fancy Box", all links to JPG, GIF and PNG images should be automatically opened in a Gnome-style lightbox that floats over the web page (See https://wordpress.org/plugins/easy-fancybox/)

But its not the case of links to images inserted via "The Paste". I am wondering what could be done to have this combination working ?

Copying picture from browser does not upload picture but instead uses url

When you copy a picture from a browser (for example this image) using right click > copy image and paste it in the editor, it attaches an URL instead of uploading the image data. This is problematic because your site is now going to refer to another server that is not yours to load the image. The server can be down or require authentication, which does not guarantee the availability of the image.

Plugin incompatble with "instant images" plugin

I patched it by wrapping this code with a try/catch:

               this.controller instanceof wp.media.view.MediaFrame.Select || wp.media.thepaste.supports.paste && (e = new wp.media.view.Button({
                            text: n.copy_paste,
                            className: "grabber-button",
                            priority: -64,
                            click: function () {
                                t.thepaste.active = t.thepaste.paste,
                                t.thepasteOpen(n.copy_paste)
                            }
                        }), this.thepaste.paste.grabber = new wp.media.thepaste.view.DataSourceImageGrabber({
                            controller: this.controller,
                            grabber: wp.media.thepaste.view.Pasteboard,
                            wpuploader: this.controller.uploader.uploader.uploader
                        }), this.toolbar.set("pasteModeButton", e.render()))

Here is the patched code:

                       ( function () {
						try {
							return this.controller instanceof wp.media.view.MediaFrame.Select || wp.media.thepaste.supports.paste && (e = new wp.media.view.Button({
								text: n.copy_paste,
								className: "grabber-button",
								priority: -64,
								click: function () {
									t.thepaste.active = t.thepaste.paste,
									t.thepasteOpen(n.copy_paste)
								}
							}), this.thepaste.paste.grabber = new wp.media.thepaste.view.DataSourceImageGrabber({
								controller: this.controller,
								grabber: wp.media.thepaste.view.Pasteboard,
								wpuploader: this.controller.uploader.uploader.uploader
							}), this.toolbar.set("pasteModeButton", e.render()))
						} catch (e) {
							return null;
						}
					})

Javascript Error

Hi,

After upgrading to the latest version, i get the following Javascript error on the debug console. Using Chrome, and WP version 6.3.1.

uploader.jsx:128 Uncaught (in promise) TypeError: e.getSource is not a function
at uploader.jsx:128:24
at Array.filter ()
at F.Uploader. (uploader.jsx:127:57)
at the-paste.js?ver=2.0.4:13:54580
at Array.forEach ()
at the-paste.js?ver=2.0.4:13:54549

I am trying to copy an image from another chrome page, and paste directly into the library.

Edit, everything used to work fine on 1.1.2 using the exact same setup.

2.0.1 and 2.0.2 are broken - The Paste doesn't load

In classic editor (TinyMCE):

wp-tinymce.js?ver=49110-20201110:3 Failed to initialize plugin: the_paste TypeError: Cannot read properties of undefined (reading 'options')
    at new n (the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:519)
    at Ew (wp-tinymce.js?ver=49110-20201110:3:330473)
    at Array.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:332223)
    at Object.jt [as each] (wp-tinymce.js?ver=49110-20201110:3:29356)
    at Aw (wp-tinymce.js?ver=49110-20201110:3:332173)
    at tN.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:333551)
    at Array.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:96969)
    at jt (wp-tinymce.js?ver=49110-20201110:3:29356)
    at u (wp-tinymce.js?ver=49110-20201110:3:96914)
    at n (wp-tinymce.js?ver=49110-20201110:3:96402)
Th @ wp-tinymce.js?ver=49110-20201110:3
wp-tinymce.js?ver=49110-20201110:3 Failed to initialize plugin: the_paste TypeError: Cannot read properties of undefined (reading 'options')
    at new n (the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:519)
    at Ew (wp-tinymce.js?ver=49110-20201110:3:330473)
    at Array.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:332223)
    at Object.jt [as each] (wp-tinymce.js?ver=49110-20201110:3:29356)
    at Aw (wp-tinymce.js?ver=49110-20201110:3:332173)
    at tN.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:333551)
    at Array.<anonymous> (wp-tinymce.js?ver=49110-20201110:3:96969)
    at jt (wp-tinymce.js?ver=49110-20201110:3:29356)
    at u (wp-tinymce.js?ver=49110-20201110:3:96914)
    at Ri.loadScripts (wp-tinymce.js?ver=49110-20201110:3:97028)

The Paste 2.0.9 problem

Greetings

I noticed the following problems when using the classic editor together with the TinyMCE plugin.

  1. The Paste disable button is missing
  2. When inserting the display, the tag is missing.
  3. The plugin started to work on inserting text with formatting, for example, if I copy the tag text and immediately paste it into the text.

File size exceeds NaN byte

The paste function seems to be broken for me after the update to 2.1.0. the pasted image disappears in a slit second and i get the error message File size exceeds NaN byte.
Any tips on how to resolve this?
Thank you

when uploading images, some will remain as BASE64

I upload an image, but when I randomly check, a few images sometimes are left as base64 in the post content instead.

This can be a big problem as it shows up on RSS feeds and other locations.

If upload fails, it should indicate this or remove the image but not keep it as BASE64

Does not work with MS Onenote on Windows

Copy a image from Onenote, get the result of image src ="file://" instead of uploading image.
For example:
<p><img id="thepasted-2" src="file:///C:/Users/username/AppData/Local/Temp/msohtmlclip1/02/clip_image001.jpg" alt="" width="1920" height="1080" /></p>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.